Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
bmosher3
Contributor
Contributor

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
michael_gardner
Creator III
Creator III

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.

dennisnet
Partner
Partner

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.