Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vidyasagar159
Creator II
Creator II

Compare Dimension values using Variable expression

Hi All,

I have a simple requirement. But facing challenges to achieve it.

Question: From the below table compare Fruits sales by Year.

TableA: 

Fruits Year Sales
Grapes 2021 -38
Grapes 2022 10
Apples 2020 20
Apples 2021 30
Apples 2022 50

 

TableB:

Fruits Year Sales Comparing Grapes
Apples 2020 20  
Apples 2021 30 -38
Apples 2022 50 10

 

below are expressions tried in Set Analysis for Comparing Grapes, but nothing works, maybe it's because Frutis is a default single select filter. Grapes value in set analysis has to be Varaible. 

  1. = Sum(total {$<Frutis={'Grapes'}>} Sales)
  2. = aggr(Sum(total {$<Frutis={'Grapes'}>} Sales),Fruits,Year)

I want to use this expression under the combination chart, where the User can choose his Fruit from the Default filter and if want to compare this with other Fruit then uses Input Variable.

I am new to Qlik, Help would be appreciated.  

1 Solution

Accepted Solutions
vidyasagar159
Creator II
Creator II
Author

I have tried Alternate State. Looks like it's working. I have created the following expression

Sum({"Alternative State"} Sales). 

View solution in original post

1 Reply
vidyasagar159
Creator II
Creator II
Author

I have tried Alternate State. Looks like it's working. I have created the following expression

Sum({"Alternative State"} Sales).