Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
kumarkp412
Creator II
Creator 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
tresesco
MVP
MVP

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

Anil_Babu_Samineni

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))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kumarkp412
Creator II
Creator II
Author

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

Anil_Babu_Samineni

Looks like working?

Capture.JPG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kumarkp412
Creator II
Creator II
Author

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

Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful