Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to reference the selections on a field from a specific alternate state.
I can do this when a function allows set analysis, but it doesn't seem to work on a function like getselectedcount() that doesn't have a set analysis option.
Is there a way around this?
i.e.
=MaxString({[PerfTRAC-Periods]}PerfReturnPeriods_Desc)
returns the max from the state 'PerfTRAC-Periods'
attempting the same below doesn't work
=GetSelectedCount({[PerfTRAC-Periods]}PerfReturnPeriods_Desc)
A GetSelectedCount could be translate into:
count(distinct {[PerfTRAC-Periods]} PerfReturnPeriods_Desc)
How about
=GetSelectedCount(Only({[PerfTRAC-Periods]} PerfReturnPeriods_Desc))
That doesn't seem to work; however, if i take out the getselectedcount(), it will return a value if 1 selected, else null.
That's what i'm testing for in the getselectedcount() so my follow-up question would be, can i easily test that for null?
something like:
=if(only({[PerfTRAC-Periods]}PerfReturnPeriods_Desc)=Null(),
'MTD',
only({[PerfTRAC-Periods]}PerfReturnPeriods_Desc))
this doesn't seem to work, but how could i test that the only function returned nothing?
A GetSelectedCount could be translate into:
count(distinct {[PerfTRAC-Periods]} PerfReturnPeriods_Desc)
Mark
When you have got the getselectedcount() for your required Alternate State what are you going to do with the output ?
I ask that as you may be able to define the Alternate State outside the expression. I.e. if you want to display the output number in a Text Box then could you set this object's State to the Alternate.
Best Regards, Bill
I'm using it in a function for the title of a chart, so unfortunately I can't just set the state of the object. I always seem to find the most difficult problems ![]()
Hi,
count(distinct {[PerfTRAC-Periods]} PerfReturnPeriods_Desc)
this is not correct, becuse when you have no selection on field, you will get the distinct count of field values ( for example 10 ) from count function. At the same time you will get the 0 from GetSelectedCount function that correct is.
Best regards
Peyman