Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
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
Not applicable

Re: Last 14 days data

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

Re: Last 14 days data

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

Re: Last 14 days data

I think you have too many $$ there

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

Vlad