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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Last before value in textbox

Hi I have  a requirement to show the last 5 values of listbox in text box separately.

the listbox has weekrange values.

I have got it for lastvalue using MaxString(Week_Range)

Can you please help with the last before values

Find the attachment of the listbox

Thanks for the help in advanceCapture1.PNG

7 Replies
sunny_talwar

May be try this

FirstSortedValue(Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 1)

FirstSortedValue(Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 2)

FirstSortedValue(Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 3)

FirstSortedValue(Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 4)

FirstSortedValue(Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 5)

Anonymous
Not applicable
Author

Thanks for reply

it doesn't work ;(

Is there any other possible way

sunny_talwar

When you say it doesn't work, would you be able to elaborate a little? It gives null, it gives a wrong number?

Anonymous
Not applicable
Author

It gives mull value -

sunny_talwar

How about this

FirstSortedValue(DISTINCT Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 1)

FirstSortedValue(DISTINCT Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 2)

FirstSortedValue(DISTINCT Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 3)

FirstSortedValue(DISTINCT Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 4)

FirstSortedValue(DISTINCT Week_range, -Date#(SubField(Week_range, '-', 1), 'YYYY-MM-DD'), 5)

Anonymous
Not applicable
Author

Thanks a lot

It worked

sunny_talwar

Awesome, please close the thread by marking the correct response.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny