Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

help in expression

got a pivot table with Month as Dimension

my expression is simple sum(Sales)

however for each month I want to display a value representing the sales for previous month

Message was edited by: Ali Hijazi

I can walk on water when it freezes
11 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

maybe something like :

=COUNT({<Field_Month={$(=Month(AddMonths(Date(Today()),0)))}>}COUNTER)

addMonths() should be the key

ali_hijazi
Partner - Master II
Partner - Master II
Author

no cause there might be more than one month displayed

this works if one month is selected

I can walk on water when it freezes
maleksafa
Specialist
Specialist

can you upload a sample document.?

agomes1971
Specialist II
Specialist II

Hi,

if you have for example select the present year - 2014.

You can do like this:

Sum({$<Year={">$(=Year-5)<=$(=Year-1)"}>}Sales)/1000.

Now think like they were months...

Hope it helps

André Gomes

Not applicable

Hi,

Try this

sum({<Month={$(=Month(AddMonths(Date(Today()),-1)))}>} Sales)

ali_hijazi
Partner - Master II
Partner - Master II
Author

check attached sample data in excel

I can walk on water when it freezes
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
MarcoWedel

use before(sum(Sales)) or above(sum(Sales))

(supposed there are values for each month in your model)

hope this helps

regards

Marco

ali_hijazi
Partner - Master II
Partner - Master II
Author

but I need the dimension to be month jan, feb,...

I can walk on water when it freezes