Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
brunov86
Contributor II
Contributor II

Year and Previous Year Issue - Set Analysis

Hello all,

I'm having an issue on set analysis regarding Year and Previous Year.

I have 2 KPIs:

- 1 shows the number of student for the year selection

-1 shows the number of student for the year selection - 1 year.

The issue I have is when I select a year I have the same number for both KPIs.

Year Selection KPI:

count(distinct ${<[Calendar_Year]={$(=max([Calendar_Year]))},[ClassStatus]={'Registered'},[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])

Year Selection-1 year KPI:

count(distinct ${<[Calendar_Year]={$(=max([Calendar_Year])-1)},
[ClassStatus]={'Registered'},
[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])

I try to identify what is wrong with my set analysis but cannot see.

Bruno

 

Labels (1)
1 Solution

Accepted Solutions
TimvB
Creator II
Creator II

The dollar in front of the set analysis is incorrect. Try this:

Year Selection KPI:

count(distinct {<[Calendar_Year]={$(=max([Calendar_Year]))},[ClassStatus]={'Registered'},[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])

Year Selection-1 year KPI:

count(distinct {<[Calendar_Year]={$(=max([Calendar_Year])-1)},
[ClassStatus]={'Registered'},
[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])

View solution in original post

3 Replies
TimvB
Creator II
Creator II

The dollar in front of the set analysis is incorrect. Try this:

Year Selection KPI:

count(distinct {<[Calendar_Year]={$(=max([Calendar_Year]))},[ClassStatus]={'Registered'},[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])

Year Selection-1 year KPI:

count(distinct {<[Calendar_Year]={$(=max([Calendar_Year])-1)},
[ClassStatus]={'Registered'},
[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])

maniram23
Creator II
Creator II

HI Gentleman,

Please try below one.
Year Selection KPI:

count(distinct {<[Calendar_Year]={'=$(=max([Calendar_Year]))'},[ClassStatus]={'Registered'},[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])

Year Selection-1 year KPI:

count(distinct {<[Calendar_Year]={'=$(=max([Calendar_Year])-1)'},[ClassStatus]={'Registered'},
[FinalStatus]={'Absent','Failed','In-Progress','Passed'}>} [studentid])
brunov86
Contributor II
Contributor II
Author

Hello Tim,

Thank you very much for your inputs. It works well 😀.

Bruno