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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
anuradhaa
Partner - Creator II
Partner - Creator II

Filter based on date

I'm using below expression to get averages of previous day sales. My report reloads everyday at 07.00 AM.

avg({$<nw_date={"=nw_date>=date(ReloadTime()-1,'DD-MM-YYYY')"},type={"I"}>} ,sales)

Can you please tell me is it corrects?

i found that expression in forum. but i can't understand that expression. can you please explain that

14 Replies
sunny_talwar

Just the previous day data? Assuming you nw_date is just a date (and not a timestamp)

you can try one of these:

{<new_date = {"$(=Date((Floor(ReloadTime) - 1),  'YourDateFieldFormat')"}>}

or

{<new_date = {"$(=Date(Today(), 'YourDateFieldFormat')"}>}

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Grate, It works. But i have country and salesman as dimensions. And date calendar. When i select date from the calendar values get changed.

I want to know how that happens and what's that value represent.

Say i have select date in September 26 ,then if the value is 58.68 what is that value?

is it the figures for september 25th

Anonymous
Not applicable

Its totally depends on your last reloadtime()...

As you asked say you have selected Sept 26,

then if last reload of your QVW was Sept 25 then you will be getting Sept 24 data which is reloadtime()-1.

Hope this will help!!

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Hi,

When it is nw_date={'=$(=date(ReloadTime()-1,'DD-MM-YYYY'))'} and no selections it will show all the values.

but when i remove "="

nw_date={'$(=date(ReloadTime()-1,'DD-MM-YYYY'))'} it shows prev day data.


but when i change date by using selection box that value doesn't change.

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Can i change this to have rev day results based on selected date. if i select 2014-12-31 then can i have 2014-12-30 data.

and keep default as reloaddate-1