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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
miranrai
Contributor III
Contributor III

nth Value from the list box

Hi,

I have requirement to create a straight table based on date range dependent on value selected from the DATE listbox & the nth previous date from selected date in listbox. I have attached sample qvw. Thank you for help.

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Define a variable like:

vNthDate =Date(Max({<DATE={"<=$(=Date(Max(DATE)))"}>}DATE,vNthRow))

Then expression like:

SUM({<DATE={">=$(vNthDate) <=$(=Date(Max(DATE)))"},STATUS={'F'}>}VALUE)

Capture.JPG

View solution in original post

2 Replies
tresB
Champion III
Champion III

Define a variable like:

vNthDate =Date(Max({<DATE={"<=$(=Date(Max(DATE)))"}>}DATE,vNthRow))

Then expression like:

SUM({<DATE={">=$(vNthDate) <=$(=Date(Max(DATE)))"},STATUS={'F'}>}VALUE)

Capture.JPG

miranrai
Contributor III
Contributor III
Author

When we look too hard we miss out whats most easy way.! I racked all rank, aggregate & it was most simple max function. Thank you so much Tresco