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: 
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))

0 Replies