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: 
Not applicable

Trigger to select latest 3 half yearly

Hi have a requirement to select last 3 values from the list box :

2010HI

2010H2

2011HI

2011H2

2012HI

2012H2

2013HI

2014H2

2015H1

MOSTRECENT SIX MONTH


i want to apply a trigger to capture MOSTRECENT SIX MONTH,2015H1,2014H2? But i cannot hard code as when data refreshes it should capture last 3 values everytime.


Can any one help me on this?


Khushboo


7 Replies
tresesco
MVP
MVP

Try:

Search string: ='('&Concat({<Field={"=Rank(Dual(Field,Left(Field,4)*10+Right(Field,1)))<4"}>}Field, '|')&')'

PFA

Not applicable
Author

you forgot that i need to capture MOST RECENT SIX MONTH,2015H1,2014H2.

I need to capture most recent 6 month as well?

tresesco
MVP
MVP

I.e. only last two quarters, right?

Like

='('&Concat({<Field={"=Rank(Dual(Field,Left(Field,4)*10+Right(Field,1)))<3"}>}Field, '|')&')'


?

Not applicable
Author

The data like most recent six month is coming from DB.

so i need to select this string( most recent six month) and 2015H1 and 2014H2.

Last 3 values?

can we use rank on the script side and handle this?

Thanks a ton for your help.

tresesco
MVP
MVP

Well, is this string 'MOST RECENT SIX MONTHS' is fixed or it may come as 'Most recent 3 months' or so at times?

Not applicable
Author

This string is fixed .

tresesco
MVP
MVP

Then try:

='( "MOSTRECENT SIX MONTH" '&Concat({<Field={"=Rank(Dual(Field,Left(Field,4)*10+Right(Field,1)))<3"}>}Field, '|')&')'