Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to display previous sales next to current sales in chart

Need to display prior sales in chart on same line as current sales even when the disply in the chart is limited to 2 months back. So need to display the previus of the 3rd month with the 2nd month. Not sure how to accomplish this.

6 Replies
swarup_malli
Specialist
Specialist

John,

Could you attach a sample qvw or a screen shot of how you want the data to be displayed.

SM

swarup_malli
Specialist
Specialist

Do you want the data of lets say Sales field to be concatenated ( delimited by ',') with preivous sales ,current sale ?

Not applicable
Author

Hi,

You can try using two expressions:

First Expression for actual Sales:

sum(Sales)

Second expression for two previous periods:

sum({<MonthYearField = {'$(=MonthName(AddMonths(Max(dateField),-2)))'}>} Sales)

best regards.

Not applicable
Author

mom.jpg

Not applicable
Author

In ths sample swarup, I am doing the previous and chnage based on columns to do calculations. The issue is I am opnly showing the current years data. If I have data for December 2013, the  previous for Jan 2014 wont be calculated correct? Not sure how I can get December 2013  in previous. Is that set analysis?

swarup_malli
Specialist
Specialist

John,

Try this,

in the expression field for calculating Change

try the following formula

column(1) - column(2)

Here Qlikview interprets column(1) as currentmonth ( i.e the first expression field in a table) and column(2) ( 2nd expresion column so on ) as previous month.

You could use the formula given by Oswaldo to calculate the amount for previous month, but for calculating change you can use my formula.If there are more than 2 months ( i.e. current,previous and the one prior to previous then I guess you could use if condition)

SM