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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
MuraliPrasath
Creator III
Creator III

Avg Function produces wrong result.

Hi All,

I'm using below script in bar chart as a reference line. 

I first get the interval of two dates ex:(End Date - Start Date)

then

if Start Date is greater than End Date then show as '0'.

then Aggr and Avg . 

 

=Avg(Aggr(if(
sum(12 * (Year([Valid Date]) - Year([Submission Date])) + Month([Valid Date]) - Month([Submission Date]))>0,
sum(12 * (Year([Valid Date]) - Year([Submission Date])) + Month([Valid Date]) - Month([Submission Date])),0)
,ProductName,Country))

Labels (2)
0 Replies