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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Raju_6952
Creator III
Creator III

average of Count (distinct IncidentID)

Hi,

I am calculating the incidents count for last 6 days and need average of that count. Using below mentioned expression for the same but not working...

Avg({<Incident_Date={">=$(=Date(Today()-8))<=$(=Date(Today()-2))"}>} Aggr(Count(DISTINCT IncidentID), IncidentID))

 

any suggestions?

 

Labels (1)
2 Replies
BrunPierre
Partner - Master II
Partner - Master II

Try

=Avg(Aggr(Count(DISTINCT {<Incident_Date={">=$(=Date(Today(1)-6))<=$(=Date(Today(1)))"}>}IncidentID), IncidentID))

Anil_Babu_Samineni

I would rather do this, Today() is not accurate. 

=Avg(Aggr(Count(DISTINCT {<Incident_Date={">=$(=Date(Max(Incident_Date)-6))<=$(=Date(Max(Incident_Date)))"}>}IncidentID), IncidentID))

In few case, The same filter need to apply outer analysis as well like,

=Avg({<Incident_Date={">=$(=Date(Max(Incident_Date)-6))<=$(=Date(Max(Incident_Date)))"}>} Aggr(Count(DISTINCT {<Incident_Date={">=$(=Date(Max(Incident_Date)-6))<=$(=Date(Max(Incident_Date)))"}>} IncidentID), IncidentID))

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