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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue with Average

Hi All,

I had come up with a scenario, where I should calculate the number of days between two dates for a particular instance. Then after calculating the days between them, i need the avg of those days.

So, in the expression I gave avg(Days), when I cross check the data manually it is varying.

So should i write something else in the expression??

Kindly help me in this scenario.

Thanks,

Sindhu

Labels (1)
7 Replies
MK_QSL
MVP
MVP

Number of Days between two Dates...

Interval(Date2-Date1,'dd')

But don't get the logic behind Avg of this !

maxgro
MVP
MVP

avg(Date2 - Date1)

Not applicable
Author

Hi,

I had calculated the number of days with networkdays formula, where i'm able to achieve the days.

But the issue with calculating the average of all those days.

Eg..

3

4

5

6

these are the days with respect to some instance, now the average of (3,4,5,6) i need, when i use avg(days) its giving wrong results.

Hope this gives an idea.

MK_QSL
MVP
MVP

You should use

Aggr(Avg(Days),YourDimension)

Not applicable
Author

I have tried, but it didn't work.

MK_QSL
MVP
MVP

Provide me some proper 10 lines sample data. Would like to help you on this matter...

Not applicable
Author

Hi Manish,

Thanks for your help.

I missed one logic in the script, now I have fixed and able to get the results.