Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

dhasharadh
New Contributor III

How to calculate the Avg of fully used Tariffs..??

Hi All.

my issue is bit confusing me. we have Tariffs(ex:mobile recharge plans) which will be sold and consumed we are reporting on consumption so we are tracking how many are consumed in a month, out of which how many are fully consumed (means consumed in the same month completely), Partially consumed (consumed in the 2 months like 15 days in March and 15 Days in April ex: recharged on Mar 15 so validity till Apr 15)

Now i need Average of Fully consumed passes in a month wise. below are the values look like, Now can any one suggest me how to calculate the avg of days to fully consume passes. thanks in advance.

the formula we are using is (NUM_OF_FULLY_CONSUMED * NUM_OF_DAYS)/SUM(NUM_OF_DAYS)

was not sure whether the above is correct or not please suggest.

3 Replies
vishsaggi
Esteemed Contributor III

Re: How to calculate the Avg of fully used Tariffs..??

May be this?

= Sum(NUM_OF_FULLY_CONSUMED * NUM_OF_DAYS)
   /

   SUM(NUM_OF_DAYS)

dhasharadh
New Contributor III

Re: How to calculate the Avg of fully used Tariffs..??

thanks Nagaraju,

what is the wrong in the below expression :

= Sum({<TYPE={LDP} and NUM_OF_FULLY_CONSUMED<>0 >}AVG_DAYS_SUM) / Sum({<TYPE={LDP} and NUM_OF_FULLY_CONSUMED<>0>}NUM_OF_DAYS)

vishsaggi
Esteemed Contributor III

Re: How to calculate the Avg of fully used Tariffs..??

Try this?

= Sum({< TYPE={'LDP'}, NUM_OF_FULLY_CONSUMED = {'<>0'} >} AVG_DAYS_SUM) /
Sum(TOTAL {< TYPE={'LDP'}, NUM_OF_FULLY_CONSUMED = {'<>0'} >} NUM_OF_DAYS) 

OR

= Sum({< TYPE={'LDP'}, NUM_OF_FULLY_CONSUMED -= {0} >} AVG_DAYS_SUM) /
Sum(TOTAL {< TYPE={'LDP'}, NUM_OF_FULLY_CONSUMED -= {0} >} NUM_OF_DAYS) 

Community Browser