Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
MK9885
Master II
Master II

current quarter month counts

Hello,

I've a set expression which I need to add current quarter function.

If (GetSelectedCount ([Year List]) = 0 ,

     

       count ({<[P Flag] ={1}, LastMnthPerQtr={1},Num_Month = {$(=Max(Num_Month))}, [S Flag] = {1}>} DISTINCT([E Number]))

       +sum({<[S Flag]={1},LastMnthPerQtr={1},Num_Month = {$(=Max(Num_Month))},[DP Flag]={1}>}([P Count])),

  

       If (GetSelectedCount ([Year List]) > 0 and GetSelectedCount (Month) = 0 and GetSelectedCount (Quarter) = 0,

     

              count ({<[P Flag] ={1},  LastMnthPerQtr={1},[S Flag] = {1}>} DISTINCT([E Number]))

              +sum({<[S Flag]={1},LastMnthPerQtr={1},[DP Flag]={1}>}([P Count])),

            

              if (GetSelectedCount (Quarter) > 0,

                         

                     count ({<[P Flag] ={1}, [S Flag] = {1}>} DISTINCT([E Number])))

                     +sum({<[S Flag]={1},[DP Flag]={1}>}([P Count])))

If nothing is selected it should show me counts from Last month last quarter.

Ex: for the month of 2011----Q1, MAR-1111 Q2 JUN- 2222, Q3 SEP- 3333, Q4 DEC-4444

For the month of 2012-------Q1, MAR-5555 Q2 JUN- 6666, Q3 SEP- 7777, Q4 DEC-8888 and so on.. until 2016 Q4 Oct

Default chart values for 2011 should be 4444 and for 2012 8888 and so on.... (Last month last quarter as default)

I can see every counts but I'm missing the 2016 counts, it is showing 0 counts (thought I've the data) and if select 2016, Quarter 4 it is showing me data for 2 months (until Oct).

I used

If (GetFieldSelections ([Year List]) = year(today()) ,

       count ({<[P Flag] ={1},[Rolling 3]={1}, [S Flag] = {1}>} DISTINCT([E Number])))

As my latest yr filter but it is not coming up...

Can anyone please help me with this?

Update:

Below expression I'm using in text box to test and i'm getting counts but in bar chart i'm not.

if([Rolling 3]=1,

count({<[P Flag] ={1},[Rolling 3]={1},Num_Month = {$(=Max(Num_Month)-2)}, [Year List] = {$(=Max([Year List]))},[S Flag] = {1}>} DISTINCT([E Number])),

stalwar1‌ @

Thanks.

0 Replies