17 Replies Latest reply: May 11, 2018 6:50 PM by Jodi Hudson

# 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.

• ###### Re: Month Over Month Sales

your first expression is :

sum(Sales)

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

and see what happens

• ###### Re: Month Over Month Sales

3rd column as: !

peek(sum(Sales))

• ###### 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

• ###### 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.

• ###### Re: Month Over Month Sales

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

• ###### Re: Month Over Month Sales

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

Jodi

• ###### 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.

• ###### Re: Month Over Month Sales

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

• ###### Re: Month Over Month Sales

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

I’m getting all zeros in that column.

• ###### Re: Month Over Month Sales

it should be something like that what is the name of your Date field like if MonthofYear than

• ###### Re: Month Over Month Sales

The Date field is called Date.  In my formula, I convert MonthYear to a date.

• ###### Re: Month Over Month Sales

So

can you share some data or file?

• ###### Re: Month Over Month Sales

I tried that already and got all zeros.  Below quit working, too.  I’m sorry, I don’t think there’s a way to share a file.  I’m pretty sure I’d be in trouble if I sent over company data.  Without any codes, it looks like this:

• ###### Re: Month Over Month Sales

How you are showing Last month in your table> Can you share the F(x)