Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

arusanah
Contributor

help with expression

Since we cannot set default value for app , I'm trying to modify expressions for visualizations to set default value but its throwing error.

pls help!!!

count( distinct {$<if(GetSelectedCount(MonthYear)=0,MonthYear={date(max(MonthYear-1),'MMM-YYYY')}),[Enrollment]={'Enrollment'}>}[IDN_RCPT])

4 Replies
MVP
MVP

Re: help with expression

Try this:

If(GetSelectedCount(MonthYear) = 0, Count(DISTINCT {<MonthYear={"$(=Date(AddMonths(Max(MonthYear), -1),'MMM-YYYY')}, [Enrollment]={'Enrollment'}>} [IDN_RCPT]), Count(DISTINCT {<[Enrollment]={'Enrollment'}>} [IDN_RCPT]))

arusanah
Contributor

Re: help with expression

Hi Sunny,

Above expression doesn't work.

MVP
MVP

Re: help with expression

Sorry, I missed a double quote, try this:

If(GetSelectedCount(MonthYear) = 0, Count(DISTINCT {<MonthYear={"$(=Date(AddMonths(Max(MonthYear), -1),'MMM-YYYY')"}, [Enrollment]={'Enrollment'}>} [IDN_RCPT]),Count(DISTINCT {<[Enrollment]={'Enrollment'}>} [IDN_RCPT]))

arusanah
Contributor

Re: help with expression

this part of expression is not working

Count(DISTINCT {<MonthYear={"$(=Date(AddMonths(Max(MonthYear), -1),'MMM-YYYY')"}, [Enrollment]={'Enrollment'}>} [Recipient Identifier]))