# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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)... :

 X Y CountXperY 1 1 3 2 1 3 3 1 3 4 2 2 5 2 2 6 3 1

Hope you can help me. Thanks alot. 🙂

Best regards

1 Solution

Accepted Solutions
Partner

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

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

Result:

5 Replies
Partner

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

count(total <Y> X)

Result :

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:

 X X per Y 1 3 2 3 3 3 4 2 5 2

I hope this is possible with Qlik.

Best regards.

New Contributor III

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

Hello,

Please try the below mentioned code.

A :
x,y
1,1
2,1
3,1
4,2
5,2
6,3
];

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

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

Partner

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

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

Result:

New Contributor II

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

Thanks alot thats great!