Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I use the Vizlib calendar extension in an app.
I want the app when open to present data for the previous 5 days .
I use the "Initial Selection" and can set a "Initial Start Date".
What should the formula be in order to present the previous 5 days?
Hi!
I've try that but the selected range is removed when the app is closed and opened again
Did you try the extension I attached? The vizlib filter doesn't help this problem, but the Simple field select does.
Hi!
What should the expression look like in 'Simple field select' -> 'Select this one as default'?
Hi Stefan,
As it's an extension, this is only applied on a sheet level, so it will only apply the selection if the sheet it's opened.
Same would happen with the vizlib filter (which has a similar option), or any other extension really.
Cheers,
David
Hi!
The sheet has a table that contains data for several weeks. When the app is opened i want to present data for e.g. only the previous 5 days.
If it's possible to do this without using the Wizlib Filter or Calendar it's OK with me.
I need to have a filter since the user should have the possibility to select another date range when they are working with the app.
You can certainly do that using the vizlib filter with:
If you want to select the last 5 days, just convert that expression into the comma separated dates you'd like to select for the user using Qlik Expressions.
I hope this helps,
David
Hi!
Isn't this hard coded dates?
What I need is that it always should show the previous 5 days. I.e 5 days back from the date when the app is opened
Hi Stefan,
If you want to select the last 5 days, just convert that expression into the comma separated dates you'd like to select for the user using Qlik Expressions.
You'll have to calculate those dates there, there multiple ways to do it, ie: using concat()
Best,
David
Hi!
I don't want to select the last 5 days manually.
I need an expression that always calculates the previous 5 days.
E.g. today (2018-08-23) the result should be 2018-08-22 ->08-18.
Tomorrow the result should be 2018-08-23 ->08-19
Try creating variables like
d1 = Date(max(dateField), 'YYYY-MM-DD')
d2 = Date(max(dateField)-1, 'YYYY-MM-DD')
d3 = Date(max(dateField)-2, 'YYYY-MM-DD')
d4 = Date(max(dateField)-3, 'YYYY-MM-DD')
d5 = Date(max(dateField)-4, 'YYYY-MM-DD')
and then use David's format and put:
'd1,d2,d3,d4,d5'
or
'$(d1),$(d2),$(d3),$(d4),$(d5)'