Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to create a straight table that compares year-over-year revenue. Each year in the data set is a new column in the table, with the expression being the sum of revenue. When no years are selected (in list boxes), the table should show all years. When a year/multiple years are selected, I want the deselected column years to hide. To do so, I'm using a condition on each expression using GetFieldSelections() as show below (this example would be for column/year 2011):
GetFieldSelections(CalendarYear) = '2011' or GetSelectedCount(CalendarYear) = 0
The second part of the condition works correctly (show column if no fields are selected), but the GetFieldSelections() function won't work here for all cases because the return type is a string of values separated by a comma. If only year 2011 is selected, the condition works as desired, but when multiple years are selected (including 2011), the function return multiple years and the condition is always executed as false. Is there another string function I can use here to see if a certain value exists in the set?
Hi,
You can use
Index(GetFieldSelection(CalendarYear), 2011) >0
Regards
Aurélien
Hi,
You can use
Index(GetFieldSelection(CalendarYear), 2011) >0
Regards
Aurélien
Paul,
Take a look at the index() function in combination with concat:
index(concat(distinct [Calendar Year], ','), '2011')
no need to check for "no selections" anymore
Regards,
Michael
Perfect, thanks!