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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to select second maximum value

Hi

  We have list of years followed by

2014

2013

2012

2011

We want compare 2014 and 2013.how to select second maximum value from

  Kindly advise me

11 Replies
tresesco
MVP
MVP

Had you been able to upload a sample qvw, this thread would have been much shorter with you got the answer.

PradeepReddy
Specialist II
Specialist II

I am assuming that you are showcasing the comparsion in BarChart. We can achieve this using set analysis.


Method-1:

1) Take a calculated dimension as

     if(CLNDR_YR>=$(=max(CLNDR_YR,2)),CLNDR_YR)

2) take the expression as

    sum(HWB_WT/100)+sum(VOLUME_IN_TUES)

3) Suppress the NULL value

Method-2:

1) Take the CLNDR_YR as dimension

2)  write the expression as bellow

     (Sum({$<CLNDR_YR={'>=$(=max(CLNDR_YR,2))'}>}HWB_WT)/100)+(sum({$<CLNDR_YR={'>=$(=max(CLNDR_YR,2))'}>}VOLUME_IN_TUES))

Regards,

Pradeep