Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
43918084
Creator II
Creator II

Set analysis with dynamic date

I want to count the maximum job run within a previous day of the specified date [Running date]

Below is my set analysis.

max(aggr(Count({<[Start 1h]={">00:00:00"},[Start 1h]={"<=23:00:00"}>}
distinct [Run Id & Job Name Key]),[Running Date Start 1h], [Running Date],[Project Name]))

 

But the result return the maximum run of specified date, not the previous date.  

Would appreciate some guidance on this.  many thanks.

Labels (3)
6 Replies
jochem_zw
Partner Ambassador
Partner Ambassador

Your syntax is not correct, maybe try this:

max(aggr(Count({<[Start 1h]={">00:00:00 <=23:00:00"}>}
distinct [Run Id & Job Name Key]),[Running Date Start 1h], [Running Date],[Project Name]))

 

43918084
Creator II
Creator II
Author

Thanks a lot for your advice.  It still does not change.

My formula objective is that if user chooses [Running Date]=31-Jul-2023

The Max count will return the result for [Running Date]=30-Jul-2023

jochem_zw
Partner Ambassador
Partner Ambassador

Try this:

max(aggr(Count({<[Running Date]={“$(=Date(only([Running Date])-1))"}>}
distinct [Run Id & Job Name Key]),[Running Date Start 1h], [Running Date],[Project Name]))

43918084
Creator II
Creator II
Author

Thank you again for your expert guidance.  The result still gives the specified date count not the previous day

Anil_Babu_Samineni

@43918084 What i see in your analysis expression you have used only Time format, But this will recognize the date 🙂 My best assumption to add dimension with full timestamp field to overcome this. 

Is this field [Running Date] come from full timestamp?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
43918084
Creator II
Creator II
Author

Thanks a lot for your suggestion and guidance .  I ve changed to below and still no change 🤔

=max(aggr(Count({<[Start 1h]={">00:00:00 <=23:00:00"}>+<[Running Date]={"$=(timestamp([Running Date]-1,'dd-MMM-yyyy'))"}>}
distinct [Run Id & Job Name Key]),[Running Date Start 1h], [Running Date],[Project Name]))