Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
kumarkp412
Contributor II

Avg of Previous month vs Current month

Hi All,

I have the data on month on month. I were struct in calculate  average of current month vs previous month .

Also i have created the master calendar to get the months as fiscal  year.

The data is like below

MonthValue
Mar100
Apr120
May90
Jun80

The required outut is

MonthPrevious month valuecurrent ValueAvg
mar100
Apr100120110
May12090105
Jun908085


To show the output in  table i am getting the output properly, but when i use the same expression for the line chart it was not giving the correct value .

Can any one help me on this to show these results in a line chart .


Thanks in advance


Thanks

Kumar KVP




6 Replies
MVP
MVP

Re: Avg of Previous month vs Current month

Could you share your sample qvw that demonstrates the issue in line chart?

Re: Avg of Previous month vs Current month

May be this?

Previous month value

********************

Above(Sum(Value))

Current Value

*************

Sum(Value)

Avg

***

Above(Sum(Value)) + Sum(Value) / 2

OR

RangeAvg(Above(Sum(Value)), Sum(Value))

Life is so rich, and we need to respect to the life !!!
kumarkp412
Contributor II

Re: Avg of Previous month vs Current month

Hi Anil,

When I use the mentioned functions it was near to that value.

I am using a Line chart will the months of one year (i.e from Apr to Mar). The above function for the month of April it was not showing the value.

Thanks in advance.

Thanks

kumar KVP

Re: Avg of Previous month vs Current month

Looks like working?

Capture.JPG

Life is so rich, and we need to respect to the life !!!
kumarkp412
Contributor II

Re: Avg of Previous month vs Current month

Hi Anil,

Thanks for your reply.

I agree it was coming in this line chart with data i provided . But when we are going to represent the current fisical year(17-18) months into the chart.

It was not giving the value for the month April.

For sample:

MonthValue
Mar-17100
Apr-17120
May-1790
Jun-1780

kindly help me on this.

Thanks

Kumar KVP

Re: Avg of Previous month vs Current month

Image of your expected visualization. Not sure whether there is any Fiscal Fields having in the script

Life is so rich, and we need to respect to the life !!!
Community Browser