Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ashis
Creator III
Creator III

How to calculate last n days run time in QlikView expression

Hi ,

I have straight table that have date field , location and the expression .

In the expression , I am having this below expression, if my todays run time is greater than last 10 days max run time then , show me the data .

Here is the expression

=if(aggr(max({<Date={"$(vEndDate)"}>}Query),Location)>
aggr(max({<Date={">=$(vStartDate) <=$(vEndDate)"}>}Query),Location),
aggr(max({<Date={"$(vEndDate)"}>}Query),Location))

vEndDate ==max(Date) ;

vStartDate = date($(=max(Date) -10),'DD/MM/YYYY') ;

when i run this expression separately without the if condition if works fine but inside if statement it is not working.

Please help.

1 Reply
Brett_Bleess
Former Employee
Former Employee

Best I have is the following Design Blog post that may provide some clues:

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

Here is the base URL for the area if you want to search further:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.