Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jhudson1
New Contributor

Month Over Month Sales

I've tried variations of all the formulas I've found on here for month over month, and so far none of it works.  I need to see sales month over month like this, MonthYear, that month's sales, then the previous month's sales in the 3rd column.  Please somebody help me.

17 Replies
omarbensalem
Esteemed Contributor

Re: Month Over Month Sales

your first expression is :

sum(Sales)

add, in the 3rd column : above(sum(Sales)

and see what happens

s_premvihari
New Contributor

Re: Month Over Month Sales

3rd column as: !

peek(sum(Sales))

omarbensalem
Esteemed Contributor

Re: Month Over Month Sales

Peek is a script function; you can't use in the front end; above will replace it in the front end.

Peek can be used for the same purpose as follow, but within the SCRIPT:

QlikView Peek Function

jhudson1
New Contributor

Re: Month Over Month Sales

I'm just a user, not a developer.  I do not have access to the back end, so I can't create variables, either.  I will try the 1st option, though.

jhudson1
New Contributor

Re: Month Over Month Sales

"Above" worked.  If I reverse the sort to show most recent month first, do I use "below"?

jhudson1
New Contributor

Re: Month Over Month Sales

"Above" worked.  Trying "Below" for a reverse sort.

Jodi

jhudson1
New Contributor

Re: Month Over Month Sales

Below only works so long as I have no filters.  I have an if/then saying if the month below was 0 or null, do this.  Let's say the changeover happened in January 2018.  As soon as I filter on just 2018, there is no below and January doesn't calculate correctly.  Please, I need a formula that will bring me sales data for the previous MonthYear in each line item.

Again , I cannot create variables.

zebhashmi
Valued Contributor

Re: Month Over Month Sales

Sum({$<Date = {$(=addmonths(Date, -1))}>}Sales)

jhudson1
New Contributor

Re: Month Over Month Sales

I’m sorry, it’s not working. This is the formula I adapted from your response:

sum({$}GROSS_ACTS_REACTS_UPGRADES)

I’m getting all zeros in that column.