Skip to main content
Announcements
Qlik Acquires Upsolver to Advance Iceberg Solutions: READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Monthly Average

Hello,

Can anybody help me making Monthly Average?

I have this data:

Customer,     Date,               value    

A,               2013-08-29,       2    

A                2013-08-30,         4    

A,               2013-08-31         ,6

A                ,2013-09-01        ,4

A                ,2013-09-02         ,2

A                ,2013-09-03        ,8

A,                2013-09-04,        3

As you can i see its over TWO months.

I would like an average on month.

Like August it would be 12 / 2months = 6 in average

and in september its 17 / 2 months = almost 8

If we go into october it should automaticcaly change to be 12 /3 and 17 / 3 and so on.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Create a Month field in the script:

Load

   Customer,

   Date,

   Month(Date) as Month,

   value

From ...mysource...;

Then use the new Month field as dimension and sum(value)/count(total distinct Month) as expression.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Create a Month field in the script:

Load

   Customer,

   Date,

   Month(Date) as Month,

   value

From ...mysource...;

Then use the new Month field as dimension and sum(value)/count(total distinct Month) as expression.


talk is cheap, supply exceeds demand
Not applicable
Author

But what if it is in a textbox?