Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

belias1980
New Contributor II

Averages by Month

Hello,

I have a question - i have a request from management to do a average by month for a running total of sale Deals.

In the view, we had rounded each rep to deal total by month, so the month always returns the first of the month so we can run totals by month.

So for example the table looks like this:

Sales RepTotalDealsMonth
John Doe1409/1/2017
Steve Joe1009/1/2017
John Doe508/01/2017
Steve Joe808/01/2017

I have sale deals coming in as a sum in a pivot as measures, the exec wants a running average... so if he chooses 5 months, he wants it to do an average by 5 months...

Sum(TotalDeals)/MONTHS CHOSEN

How would i return the selected months he is using, the date is a column and the measures are above.

Thanks

Tags (1)
1 Reply
MVP
MVP

Re: Averages by Month

May be this

Sum(TotalDeals)/Count(DISTINCT Month)