Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
maschulz
Contributor
Contributor

Erstellung einer Dimension mit Bedingung

Hallo zusammen,

ich beiße mir an einem Problem die Zähne aus.

Ich habe folgende Tabelle:

NutzerProduktgruppe
1A
1C
2A
3A
4A
4B
4C
5A
6A
6B

Ich möchte hieraus eine Dimension erstellen, die nur die Nutzer zeigt, die ausschließlich das Produkt A haben und kein anderes. Meine Schwierigkeit ist hier, dass alle Nutzer das Produkt A haben, aber eben nicht B und/oder C.

Als Ergebnis hätte ich hier die Nutzer 2, 3 und 5. 

Wäre super wenn mir jemand auf die Sprünge helfen könnte.

Vielen Dank im voraus!

Viele Grüße

Matthias

1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

Denkbar wäre etwas wie das hier:

aggr(if(count(Produktgruppe) = 1 and count({< Produktgruppe ={'A'}>} Produktgruppe), Nutzer), Nutzer)

- Marcus

View solution in original post

4 Replies
marcus_sommer
MVP
MVP

Denkbar wäre etwas wie das hier:

aggr(if(count(Produktgruppe) = 1 and count({< Produktgruppe ={'A'}>} Produktgruppe), Nutzer), Nutzer)

- Marcus

Saravanan_Desingh
MVP
MVP

One solution is.

tab1:
LOAD * INLINE [
    Users, Product group
    1, A
    1, C.
    2nd, A
    3rd, A
    4th, A
    4th, B
    4th, C.
    5, A
    6, A
    6, B
];

Left Join(tab1)
LOAD Users, If(Concat(DISTINCT [Product group])='A', 'Y', 'N') As Flag
Resident tab1
Group By Users;
Saravanan_Desingh
MVP
MVP

Output.

commQV44.PNG

maschulz
Contributor
Contributor
Author

Sorry für meine späte Rückmeldung.

Die Formel hat funktioniert.

Danke!