Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis does not counting by year

Hi Guys,

I am trying to count values by year but its not giving me the count for 2018.

Can you please advise me where I am having the issue,

lease see the attached QVW file.

   

ResultF220172018
EM+1-1410
EM+1-200    0
EM+10-1710
EM+14-2910
EM+2-1110
EM+2-310
EM+26-3010
EM+3-1010
EM+3-1110

Kind regards,

Farrukh

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Your MaxYearmonth is 15/12/2017 which you use in the calendar to create Years, so there is no 2018

it seems you refer to the the wrong table for the min and max date, so I wonder how there are values for those variables/fields at all with your script in the attached qvw

let varMinDate = num(peek('MinYearMonth',0,'Facts'));

let varMaxDate = num(peek('MaxYearMonth',-1,'MinMaxDate'));

View solution in original post

6 Replies
sunny_talwar

You don't have data for Year 2018

Capture.PNG

stigchel
Partner - Master
Partner - Master

Your MaxYearmonth is 15/12/2017 which you use in the calendar to create Years, so there is no 2018

it seems you refer to the the wrong table for the min and max date, so I wonder how there are values for those variables/fields at all with your script in the attached qvw

let varMinDate = num(peek('MinYearMonth',0,'Facts'));

let varMaxDate = num(peek('MaxYearMonth',-1,'MinMaxDate'));

Anonymous
Not applicable
Author

Hi Sunny,

Thanks for highlighting this. Now its giving me the counts.

But is there any possibility that year column can be dynamic.

sunny_talwar

Use this for Max Year (2018)

Year = {"$(=Max(Year))"}

For Max Year  - 1 (2017)

Year = {"$(=Max(Year)-1)"}

Anonymous
Not applicable
Author

Thanks a mil Sunny!

Anonymous
Not applicable
Author

Hi Sunny,


Sorry for coming back to this again. I am using the below expression but below highlighted giving me blank row. not returning any value.

Variable:

Draw_EM = if(GetSelectedCount(Draw) > 0 , GetFieldSelections(Draw), 'EM+')

=Aggr(Only({$<Draw={"=$(=Draw_EM)"}, Period={">=$(=vPeriod_EM)"}>} Draw), Draw)

Can you please advise me where I am having the problem.

Kind regards,

Farrukh