summary on filter table

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
I have a filter that lists the same item multiple time. I would like to have each item show once without coding.
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
What is the source for the filter? Looks like a model which is looking up the locations on a related object. ie. Contact object while looking at Account address.
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
That is correcct
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
That is what I thought.

Change your source of locations to the related object model instead of the model in the table.
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
The data in this list that is from the parent table as well as 3 related tables.  The only way I know to expose all the fields is by drilling down thru the parent table.  Thoughts?
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Quick documentation plug here: Cheat Sheet of Filter Use Cases. I think this is case 7 (Filter based on a junction object membership), but it may also be achievable with use case 6 (Filter based on a string field).
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
By chance, is there a youtube video of this being done?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I don't think there is a video that lays out this particular use case.  Here is a video  about complex filter scenarios,  but I don't think it covers what you are trying to do.   But the document J pointed you to above has the detail.  I think use case 6 is what you need to look at. 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
I have followed the 3rd example in the video which seems it should work.  I have attached what I did as a video.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I think there is a far simpler solution.  Because City is a reference field.  Can you not use an automatic filter and just choose the City reference field?  Automatic filters do not require you to set up conditions, and handle the uniqueness problem you originally asked about.  In addition - if you need to filter on grandparent data  (the owner of accounts above the opportunity list you are on),  automatic filters will handle this as well. 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
To took out the aggregate and it really does not work,
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
still does not work.  See Link above
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I see two things in your video that may be wrong with the aggregate model you are using as the source for your filter. 

1. If you want your data to be sorted,  you need to add a field.  Just putting "DESC" will not work. In fact, I'm pretty sure that the big red error is related to that issue.  I'd start by taking all sorting out,  and get that to work first.  Then add sort order back. 

2. If your grouping field (city) is a relationship field (pulled from a list of possible cities) rather than just a free form string field,  you can not just use the referred Object Id in your aggregate model.  This is an issue we need to correct in Skuid.  You need to go through the relationship and get the actual Name field of the object you want. I can't really tell from your video which this is. 

Hopefully these ideas solve your problem. 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Ok.  I took out the the DESC and added the field name.  The field names are now showing.  However, they are not summarized.  Oldsmar shows up twice.
https://docs.google.com/file/d/0B409lhd9sYDcZGxRZ1dlOVRRVzA/edit
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Because you are going through so many objects,  your aggregate is pulling duplicate values.  If you make your aggregate model on the Zip Postal object,  or make a normal model on the City object you can achieve the uniqueness you are looking for.  You can add conditions in either case so that only City records that are associated with the Member_DNA records shown will be in the model (And therefore in your drop down). 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
What is the most efficient method?  I have filters on City, State, Zip and County all in the path: Member_DNA__c>Location__r>Zip_Postal__r. It does not seem the level should matter. I have filters like in almost all page where I am looking at name in a child record.  Once I have this working, then I can correct in all my pages. Can we do a  screen share or I can give you access.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Yup, give us access and I'll take a look.  Send me an email with the page name and steps to reproduce the issue. 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Great.  You have access.  The page is:
https://dorothy--skuid.na16.visual.force.com/apex/UI?page=D_View_Member_DNA

In the "search for member" on right type "Whita"  that will present the city selector.

I might suggest recording a small video of what you do and start creating a collection of methods for customer reference.  Sometimes a picture/video is better than words.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I missed a key issue in your first video.  And that is the problem with this stuff.  There is one way it works, and dozens of ways it can go wrong...

In your Filter Source defintion,  you had not changed the "Merge Source" property to the new model (City Grouping).   



I have changed the property and your filter now works.   You will need to create the same structure of aggregate models as the model source for your other filters. 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
I just changed that name after we talked.  It just went out to try and it 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
still does not work.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I think what you are trying to do is not possible.  It looks like you want to put a term in the search box, and then for all the filters to respond to that search term and only show cities (or states or counties or...)  that are contained in that subset of records.  To get unique values in your drop downs,  your filter source has to come from another model,  which is not filtered automatically to the records currently in the large table.   

In the image above,  if you start typing Naper..,  you will see Naperville in the filter. But if you type  Park Ridge you also see it, and the combination of a query for "Park Ridge" and "Whita" will likely not produce any results.  
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Here is the difference between city and state fields filters.  https://docs.google.com/file/d/0B409lhd9sYDcN3NRdzJuSGVKMzA/edit?pli=1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Yup.  Your city filter source  and condition were connected to different fields.  The condition was looking for the City__c (which is the ID field), and the filter source was passing it the City Name field.  They would never match.  I've put them both to the City Name field and it works.  
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Yup.  City works.  Explain again why does the City field not turn into a drop down when the list is less than 100 records?
https://docs.google.com/file/d/0B409lhd9sYDcZU5udzl0Wmk3V1E/edit?pli=1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Hmm.  I'll try again. 

First:  Your States Filter. 

The filter source here is tied to your primary model.
- This means that each row in the model will be a row in the filter's drop down box (or available to type ahead).  
- This also means that if values are repeated in that model,  they will be repeated in the drop down box.  

When you apply the search "whita"  that primary model is requeried and the list grows much smaller.  
- Now this shortened list is what is available in the filter's drop down box.  
- The shortened list means the filter will show as a drop down box, instead of the type ahead. The number of values in the list is now less than the threshold you specified for the filter.

Incidentally,  this also means that the "show all" value in the drop down is not really doing that.  It does not reset the "whita" value you typed into the search box.


Second:  Your Cities Filter.   (** I think this is the way you want to go)

The filter source here is tied to an aggregate model with one line for each city. 
- This means that the drop down will only show each city once. 

When you apply the search "whita" to the primary model,  the second aggregate model is not re-queried.  So you always get the same longer list of cities you started with, and the control does not change from a type ahead to a piclist.  (This seems like better user experience to me).  

There is not a way to have the search box values on the primary model apply to the second aggregate model. 


As I said before - these are the options you have.   
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Thanks Rob.  I did screen shots the other day before I started working on adding a filter on states.  I did not check my screen shots and right side of the filter screen shot was cut off.  I could not find the version you had fixed.  Can you again look I what I have entered wrong.  I agree, it is the second filter referenced above that works best.

I have opened up my account  

https://www.youtube.com/watch?v=WkwAaDcm-hk

Again it was "D_View_Member_DNA" the city filter.
When I go to add the same filter to state, do I create another model like "CityGrouping" called "StateGrouping"? 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You need to put the Alias from the aggregate modle grouping field into the two template fields on the filter Source properties.

 

And yes,  for state, counties, subdivisions etc.. Each will need its own aggregate model. 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Thanks Rob.