Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last 14 days data

Hi,

I have to select last 14 days data on basis of date dimension.

I am not doing this changes in data load editor, as I have other sheets in the project which uses entire data set.

I have put

only({<ORDER_DATE={">=$(=Today()-14)"}>}ORDER_DATE)

This is not working. Can you please let me know right way to do this.

Thanks,

Akanksha

3 Replies
vlad_komarov
Partner - Specialist III
Partner - Specialist III

Function Today() is not working inside SetAnalysis.

Just create a variable  let vToday = Today(); in your script and use it in your measure.

only({<ORDER_DATE={">=num$(vToday)-14"}>}ORDER_DATE)

or

let vTodayMinus2W = num(Today()) - 14;

only({<ORDER_DATE={">=$(vTodayMinus2W)"}>}ORDER_DATE)


Not to mention, this is better for performance - the function will not be executed every time the chart will be updated...


Regards,

Vlad

Not applicable
Author

Thanks Vlad for your reply!

But I am still getting invalid dimension after above changes too.

I have used below expression:

only({$<ORDER_DATE={$(=$(vTodayMinus2W))}>}ORDER_DATE)

vlad_komarov
Partner - Specialist III
Partner - Specialist III

I think you have too many $$ there

Try to use: only({<ORDER_DATE={">=$(vTodayMinus2W)"}>}ORDER_DATE)

Vlad