Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all -
I'd like to make my chart title reflect the current selections across two variables (which I have named SubSegment and SubAgency in my dataset). Ideally, the chart title would read:
"SubAgency - SubSegment, $M"
If there is no SubAgency or SubSegment selected, I'd like it to still output whatever IS selected, and if there are multiple selections, I'd like it to default to "Multiple Selections, $M". Finally, if nothing is selected (I.E I'm just looking at the total sum of my data), I'd like to display, "Total Market, $M"
Any ideas? Thanks!
Also GetSelectedCount(fieldname)
GetCurrentSelections() will return a list of the selected values for all fields
GetCurrentSelections(fieldname) will return a list of the selected values for one field
GetCurrentSelections() will insert each field on a separate line, you can remove the carriage returns like this.
REPLACE(REPLACE(GetCurrentSelections(), CHR(13), ' '), CHR(10), ' ')
Many thanks, Colin. Any idea how to deal with "Multiple Selections"? Is there a way to essentially say, "If current selections > 1, then ______"?
Have a look at only(fieldname) this will return the field name if one selection has been made, otherwise null.
Also GetSelectedCount(fieldname)
So right now I've got:
=IF(GetSelectedCount(SubAgency)>1 or GetSelectedCount(SubSegment)>1,'Multiple Selections, $M',SubAgency&' - '&SubSegment&', $M')
Which is correctly labeling the graphs when I make my singular selections, but is not working when I make multiple selections. Any ideas what's wrong with my syntax/construction?
see attachment
=IF(GetPossibleCount(SubAgency)>1 or GetPossibleCount(SubSegment)>1,'Multiple Selections, $M',
SubAgency & ' - ' & SubSegment & ', ' & num(round(sum(Expression1)/1000000),'#.##0') & ' $M')
Massimo - the problem right now isn't getting the last part of the IF function - the Else - to work, it's getting the Condition and the Then. It's not displaying "Multiple Selections, $M" when I select more than one SubAgency or SubSegment.
So what it its showing? Have you tried any other text just for testing?
Note that you need active selections in these fields, just making no selection will execute the Then branch (But Massimo's solution using GetPossibleCount() should do this).