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

Problem with aggregate/set analysis

Hi,

I'm trying to find a way to create a table where I can only see the customers with the same adress code and with demand=0.

So, I have a table like this one:

codecustomerdemand
IN008910
IN008950
IN008981
IN009292
IN0093105
IN0095113
IN0095137


And want to get one like this, for all customers with repeated adress code and demand=0:

codecustomerdemand
IN008910
IN008950


How can I do it? Should i use a pivot table? (I just can't manage it to work correctly...)

1 Solution

Accepted Solutions
martin59
Specialist II
Specialist II

So you can try this :

View solution in original post

5 Replies
martin59
Specialist II
Specialist II

Hello,

Look at the attachement and screenshots to understand.

Hope that helps you.

Not applicable
Author

Hello,

Thank you, but it doesn't seem to work (I only qview personal edition so I have some problems opening other users files).

The problem is, and I might not have explained it well enough, when I have customers where the code isn't repeated, so those will appear anyway.

codecustomerdemand
IN008910
IN008920
IN008932
IN009043
IN009054
IN009065
IN009170
IN009280
IN009391
IN0094102
IN0094112
IN0095120
IN0095131


To get to:

codecustomerdemand
IN008910
IN008920
IN0095120


So: I only want to get customers with demand zero whose code appears more than one time (example, customer 7 should not appear).

martin59
Specialist II
Specialist II

So you can try this :

jedgson
Creator
Creator

You could also create a new field (count) in the script to count the occurances of code

You could then use something like

if(count >1 and demand = 0, 1, 0)


Not applicable
Author

Thank you Martin! That's it.