Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
My eyes are going crossed trying to figure this out. Please help!
I have a filter pane (Occupation) that I want to use to dynamically create a set analysis filter.
The following set statement is successful if I only select ONE value from my Occupation filter:
count({<Occupation ={"$(=GetFieldSelections(Occupation,','))"}>}EMPLOYEE_COUNTER)
However, if I select more than one value then it can't evaluate successfully because the filter string that's built is missing quotes (' ')....so I added the Chr(39) below but can't get it to work at all now
count({<Occupation ={"$(=Chr(39)&GetFieldSelections(Occupation,Chr(39)& ','&Chr(39))&Chr(39))"}>}EMPLOYEE_COUNTER)
The goal is to have a statement that looks like the follows after the user selects 'Doctor', 'Nurse', and 'Firefighter' from the Occupation filter.
count({<Occupation = {'Doctor','Nurse','Firefighter'}>}EMPLOYEE_COUNTER)
Or if you can think of a better way to do it in general than what I'm doing, I'm all ears as well.
Thanks in advance!
But why do you even need to add set analysis for that?
Showing associated data based on selections is Natural behavior you don't need set analysis for that??
If you still need set analysis try using P () , but I must re-iterate this is not required
Example
count({<Occupation = P (Occupation)>}EMPLOYEE_COUNTER)
To concat selections try below in textbox
=$(=chr (39)&concat (distinct fieldname, chr(39)&','&chr(39))&chr(39))
Hi,
You can try this: (i removed the excess " ")
=count({<Occupation={$(=chr(39)&GetFieldSelections(Occupation,chr(39)&','&chr(39))&chr(39))}>}EMPLOYEE_COUNTER)
But why do you even need to add set analysis for that?
Showing associated data based on selections is Natural behavior you don't need set analysis for that??
If you still need set analysis try using P () , but I must re-iterate this is not required
Example
count({<Occupation = P (Occupation)>}EMPLOYEE_COUNTER)
To concat selections try below in textbox
=$(=chr (39)&concat (distinct fieldname, chr(39)&','&chr(39))&chr(39))
You can try below expression,
=if(isNull(GetFieldSelections(Occupation)),0,sum(employee_count))
Then try by selecting occupation one by one.
Thanks so much Vineeth! I knew someone would ask why I even need this because it's natural behavior....ha. I'm going to be working with the Occupation field as a data island to build the filter string to apply elsewhere for a calculation. Anyway, using the P function did the trick and is much simpler! Thanks so much.
Hi Yddona - thanks for your response - this worked as well. I just needed to remove the " ". It's always the small things that get you!