Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
MS_UK
Contributor II
Contributor II

alternate state - one table two alternate state compare two years/months

Hi All,

 

I am trying to create straight table, where my dimension is Product Number, next I need to setup 3 expression

 

1. Sum of Sales for chosen  Year and Month State_1

2. Sum of Sales for chosen  Year and Month State_2

3. Difference between two above

I have two sets of Year and Month list box, one for each alternate state

 

In my working sheet(which is under alternate state = State_1)  i created stright able under State_1

As dimension I have chosen Product_Number my expression look as below:

1) =SUM({State_1<Month = {'$(=GetFieldSelections(Month))'}>}SoldPacks)

2)  =SUM({State_2<Month = {'(=GetFieldSelections(Month))'}} >}SoldPacks)

3) Expr1-Expr2

 

The purpose of that is to allowed user to compare any month of the chosen year vs. any month of another chosen year

I.e. Mar 2018 vs Jun 2017

 

First expression is working, but I believe it is because has the same alternate state as whole sheet and object (straight table),  second one return only 0

I also tried to modify expression by adding year, the same result

=SUM({State_2<Month = {'(=GetFieldSelections(Month))',Year = {'(=GetFieldSelections(Year))'}} >}SoldPacks)

 

Could you please advise?

 

BR

Michal

 

 

 

1 Solution

Accepted Solutions
sunny_talwar

It almost seems like you just need this

State 1 expression

=Sum({State_1} SoldPacks)

State 2 expression

=Sum({State_2} SoldPacks)

 

View solution in original post

2 Replies
sunny_talwar

It almost seems like you just need this

State 1 expression

=Sum({State_1} SoldPacks)

State 2 expression

=Sum({State_2} SoldPacks)

 

MS_UK
Contributor II
Contributor II
Author

Yes, exactly I  just need this. Thank you!