Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Months difference in pivot

Hi guys!

I guess this is a simple question, but still cant find a solution.

I have a pivot like:

BGMonth1Month2Month3Month4Month5Month6Month7Month8
BG112345678
BG212345678
BG312345678
BG412345678
BG512345678
BG612345678
BG712345678

Need to create one more column with the expr to find difference between months like : Month2-Month1, Month3-Month2, etc.

Any ideas?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

If the MonthX columns are 8 different expressions you can add 7 more expressions using the column names: [Month2]-[Month1]. If you have a Month dimension pivotted horizontally and one expression you can try the before() function:

first expression: count(Value)

second expression: count(Value)-before(count(Value))


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

If the MonthX columns are 8 different expressions you can add 7 more expressions using the column names: [Month2]-[Month1]. If you have a Month dimension pivotted horizontally and one expression you can try the before() function:

first expression: count(Value)

second expression: count(Value)-before(count(Value))


talk is cheap, supply exceeds demand
maxgro
MVP
MVP

if Month is a dimension try with before(your_month_expression) ot get the "left" month

PrashantSangle

Hi,

But what if there is two dimension and one expression

for example in above

Dimension 1: Month

Dimension 2: BG

Expression : Sum(Sales)

In that case how we can find difference between two month.

Reason behind asking is I also have similar type of query.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂