Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

dvzjsnu123
Contributor

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
MVP
MVP

Re: Last before value in textbox

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)

dvzjsnu123
Contributor

Re: Last before value in textbox

Thanks for reply

it doesn't work ;(

Is there any other possible way

MVP
MVP

Re: Last before value in textbox

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

dvzjsnu123
Contributor

Re: Last before value in textbox

It gives mull value -

MVP
MVP

Re: Last before value in textbox

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)

dvzjsnu123
Contributor

Re: Last before value in textbox

Thanks a lot

It worked

MVP
MVP

Re: Last before value in textbox

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

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny