Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

karl
New Contributor II

How many distinct X-Dim-Values are there per Y-Dim-Value

Hi,

 

I didnt find an answer for this. X-Dim and Y-Dim are even in the same table, but I didnt found a formula that works in this kind of table(total, aggr)... :

XYCountXperY
113
213
313
422
522
631

 

Hope you can help me. Thanks alot. 🙂

Best regards

1 Solution

Accepted Solutions
Partner
Partner

Re: How many distinct X-Dim-Values are there per Y-Dim-Value

aggr(count({<X>}total <Y> X),Y,X)

Result:

Capture.PNG

View solution in original post

5 Replies
Partner
Partner

Re: How many distinct X-Dim-Values are there per Y-Dim-Value

count(total <Y> X)

 

Result : 

Capture.PNG

karl
New Contributor II

Re: How many distinct X-Dim-Values are there per Y-Dim-Value

Thanks for your help, but Im sorry, I made a slight mistake.

I need this value without the Y-Dimension in the table:

XX per Y
13
23
33
42
52

 

I hope this is possible with Qlik. 

 

Best regards. 

Rohan
New Contributor III

Re: How many distinct X-Dim-Values are there per Y-Dim-Value

Hello,

Please try the below mentioned code.

A :
load * inline [
x,y
1,1
2,1
3,1
4,2
5,2
6,3
];


B :
Load y,
(Count(x)) as x_p
Resident A Group by y;

 

Also, let me know if it works for you as well.edit2.png

Partner
Partner

Re: How many distinct X-Dim-Values are there per Y-Dim-Value

aggr(count({<X>}total <Y> X),Y,X)

Result:

Capture.PNG

View solution in original post

karl
New Contributor II

Re: How many distinct X-Dim-Values are there per Y-Dim-Value

Thanks alot thats great!