Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

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

Except for this extra comma before sales, it seems that it might work. Have you tested it out to check if it is giving you what you are looking for?

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

or you can try this as well

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

Where this -> ='>=' &Date(ReloadTime()-1,'DD-MM-YYYY') in a text box object needs to match the format of nw_date and needs to be the date which you want.

HTH

Anonymous
Not applicable

nw_date={"=nw_date>=date(ReloadTime()-1,'DD-MM-YYYY')"} 


this will return data which is greater than your last Previous Relaodtime i.e ReloadTime()-1 till today date

anuradhaa
Partner - Creator II
Partner - Creator II
Author

can you please explain this expression

anuradhaa
Partner - Creator II
Partner - Creator II
Author

i think that's for "nw_date>=date(ReloadTime()-1,'DD-MM-YYYY')" and what does whole thing

nw_date>=date(ReloadTime()-1,'DD-MM-YYYY') means

sunny_talwar

From what I understand, this is just trying to average sales for type I which is greater or equal to 1 day minus today's reload date and time. So if the application got reloaded at 10 am 12/2/2015 the expression will average sales for nw_date greater than or equal to 10 am 12/01/2015

anuradhaa
Partner - Creator II
Partner - Creator II
Author

If i want to get Previous day data , how can i do that.

Anonymous
Not applicable

nw_date={"=nw_date>=date(ReloadTime()-1,'DD-MM-YYYY')"}


and


nw_date={">=date(ReloadTime()-1,'DD-MM-YYYY')"}


Both expression will give same result which would be from your previous day of reload to till to date

anuradhaa
Partner - Creator II
Partner - Creator II
Author

If i want to get only the previous day, what is the best solution

Anonymous
Not applicable

Previous day of reload?

then do this:

nw_date={'=$(=date(ReloadTime()-1,'DD-MM-YYYY'))'}    //simply Remove greater sign