Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
New Contributor II

Sum of sales Expression

I have a pivot table with months as a dimension. My first expression is a simple =sum(Sales), that shows the total sales of each month.

I want to create another expression that shows the sales of the 3 previous months besides the sales each month. For example, on the month of July, my first expression would show the sales of July, while my second expression would show the sales of April, May and June. 

Thanks in advance for your help!

Labels (2)
4 Replies

Re: Sum of sales Expression

Its not straight forward to present data from another field value on a dimension value, eg June and May values on the July dimension.

One way to do this is to implement an as of calendar. Take a look at @Henric_Cronström  blog post on the topic. https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

Re: Sum of sales Expression

Perhaps this?

Dimension : Month

Expression - (1) 


Expression - (2) 

Sum({<Month = {">=$(=AddMonths(Max(Month),-3))<=$(=Max(Month))"}>} Sales)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

Re: Sum of sales Expression

Try RangeSum(Above(Sum(Sales),1,3))

See more on https://community.qlik.com/t5/Qlik-Design-Blog/The-Above-Function/ba-p/1465357



Re: Sum of sales Expression

Rafael, did any of the posters comments help you get what you needed?  If so, please be sure to use the Accept as Solution button on the one(s) that helped to let others know what worked and to give credit to the posters.


To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.