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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
MK9885
Master II
Master II

Maximum year in a Quarter

Hello,

I'd like to get an set expression for

Maximum month in current quarter

If 2011 year is selected, I want to see counts for Q1, Q2, Q3, Q4  ( in Q1 I want the count of only March, in Q2 only June.....)

Currently I'm getting Counts of 1st month for each quarter.

Below is my expression...

If (GetSelectedCount (Month) > 0 or GetSelectedCount (Quarter) > 0,

  count ({<Field1 ={1},  Field2={1}>} DISTINCT(Field2)),

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

  If (GetFieldSelections ([Year List]) = year(today()) and GetSelectedCount (Month) = 0 and GetSelectedCount (Quarter) = 0,

  count ({<Field1 ={1} , [Month Number] = {01},Field2 = {1}>} DISTINCT(Field3)),

  If (GetSelectedCount (Month) = 0 and GetSelectedCount (Quarter) = 0,

  count ({<Field1={1},  [Month Number] = {03,06,09,12},Field2 = {1}>} DISTINCT(Field3)),

  )),

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

  count ({<Field1 ={1},  [Month Number] = {01},Field2= {1}>} DISTINCT((Field3)),

  If (GetSelectedCount (Month) = 0 and GetSelectedCount (Quarter) = 0,

  count ({<Field1 ={1},  [Month Number] = {$(=Max([Month Number]))},Field2= {1}>} DISTINCT(Field3))

  ,

//--

  count ({<Field1 ={1}, [Month Number] = {$(=Max([Month Number]))}, Field2 = {1}>} DISTINCT(Field3))))))

+sum({<Field1={1},[Month Number] = {$(=Max([Month Number]))},Field4={1}>}(Field5))

stalwar1

Thanks.

Labels (1)
0 Replies