Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
MuraliPrasath
Creator III
Creator III

Compare values from the same field using filters.

Hi, 

I've a requirement, I need to compare products within the same field. Example given below with filter selections. 

Example spreadsheet attached. Any help highly appreciated. thanks!

MuraliPrasath_0-1595225881471.png 

MuraliPrasath_2-1595226167041.png

 

 

Labels (4)
1 Solution

Accepted Solutions
Kushal_Chawda

If you are going to set single field value selected then you can use below

Create two alternate states as below screenshots

Annotation 2020-07-20 123513.png

Add two filter pane with dimension Products and assign alternate stated to them like below example

Annotation 2020-07-20 123818.pngAnnotation 2020-07-20 123839.png

Then you can create a table with below dimensions and measure

Dimensions:

1) Country

2) =aggr(Only({<Products = Ref_Product::Products>} Products),Country)  ----> Reference Product

3) =aggr(Only({<Products = Target_Product::Products>} Products),Country) -----> Target Product

Measures:

1) sum({Ref_Product}Totals)  ------> Reference Total

2) sum({Target_Product}Totals) -------> Target Total

View solution in original post

6 Replies
Kushal_Chawda

What do you want to display when there is no selections in reference and target ?

MuraliPrasath
Creator III
Creator III
Author

Hi, 

When no selections by default all products will display. Actually I will be setting as only one product selected for "Reference" and one for "Target". 

PrashantSangle

check alternate state option in qlik.. 

refer below thread

https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/Visualizations/alternate...

 

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
MuraliPrasath
Creator III
Creator III
Author

Hi,

I've Alternate  method now, but my client want to achieve this without Alternate States bcos later all the expression we need to maintain the States01 & 02. which causes more complexities during Expression calculations. 

Kushal_Chawda

If you are going to set single field value selected then you can use below

Create two alternate states as below screenshots

Annotation 2020-07-20 123513.png

Add two filter pane with dimension Products and assign alternate stated to them like below example

Annotation 2020-07-20 123818.pngAnnotation 2020-07-20 123839.png

Then you can create a table with below dimensions and measure

Dimensions:

1) Country

2) =aggr(Only({<Products = Ref_Product::Products>} Products),Country)  ----> Reference Product

3) =aggr(Only({<Products = Target_Product::Products>} Products),Country) -----> Target Product

Measures:

1) sum({Ref_Product}Totals)  ------> Reference Total

2) sum({Target_Product}Totals) -------> Target Total

View solution in original post

MuraliPrasath
Creator III
Creator III
Author

Hi Kush,

I've this already using Alternate States but I want to achieve this without Alternate States. Thanks for you time and energy so far. Good Job.