Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
nazirhussain
New Contributor

Variable not working in Set Analysis

Hi,

I am using variable in my expression which has a set analysis in it. However it is not working.

The below expression works when I hardcode date in it.

count(distinct {<[MasterCalendarDateStartedRC.LocalFiscal_YearQlik]={'2018'}>} [ReportCard.studentid])

However, this does not.

count(distinct {<[MasterCalendarDateStartedRC.LocalFiscal_YearQlik]={'$(PreviousLocalYear)'}>} [ReportCard.studentid]).

My variable has proper value in it. I am able to see the proper year in my variable. However, the above expression always returns 0. Not sure, what am doing wrong.

Please help. Thanks.

2 Replies
Highlighted
Partner
Partner

Re: Variable not working in Set Analysis

You did not tell  us the content of your variable. Is it an expression? 

Try adjusting your expression to this:

count(distinct {<[MasterCalendarDateStartedRC.LocalFiscal_YearQlik]={'$(=PreviousLocalYear)'}>} [ReportCard.studentid])

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
nazirhussain
New Contributor

Re: Variable not working in Set Analysis

Thanks for responding.. I tried modifying my expression but it still returns 0.

My 'PreviousLocalYear' variable will contain year values like 2019, 2018 etc., TheLocalFiscal_YearQlik column in MasterCalendarDateStartedRC also contain year values like 2019, 2018. I am trying to retrieve values from MasterCalendarDateStartedRC table based on the year value in my variable.