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: 
Anonymous
Not applicable

set analysis for values not equal

I currently have a table with some fields that are usually equal, but sometimes are not. I would like to create another table below this one that shows only those records such that those values are not equal. ie the current selection shows me

IDquantity 1quantity 2
155
267
3712

and in the next table I want it to show

IDquantity 1quantity 2
267
3712

I'm teaching myself qlikview and just trying to do this as an exercise. Can I use set analysis for this?

2 Replies
Anonymous
Not applicable
Author

I don't think Set Analysis will work for what you are trying to achieve because it evaluates once on the entire data set.

Something like count(IF([quantity 1] <> [quantity 2],ID)) as an expression in a chart would work.

Anonymous
Not applicable
Author

If you want to do this with set analysis I would add something like this in the script:

Load ID,

          quantity1,

          quantity2,

          IF(quantity1 = quantity2, 1,0)  as Same

Resident data;


Now you can use the field Same in your set analysis.


But you can also create a new dimension, like:


Load ID,

          quantity1,

          quantity2,

          IF(quantity1 <> quantity2, ID)  as ID2

Resident data;


If you use ID2 as your dimension it should give you the result you are looking for

ID2quantity 1quantity 2
267
3712

If possible I would (personaly) always go for a solutions without set analysis.