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

Count of value pairs

Hi there,

My first post in the community, though having been months with Qlikview.

Just would like to seek some help on how I can count the occurrence of the Value Pairs. For example, I have a table of (x,y) with values: (10,20), (15,30), (10,20), (10,20), (15,20). How can I count the occurrence of each value pair which gives:

(10,20) = 3

(15,30) = 1

(15,20) = 1

Looks simple (I guess) but I cannot find an answer from the community for a whole day search. Maybe I used the wrong keywords. Thanks in advance.

Snowman

2 Solutions

Accepted Solutions
zhadrakas
Specialist II
Specialist II

Hello,

are this two field your datamodel like "x" and "y"?

if so first approach could be a table with

dimension:  =x&y

expression: count(x&y)

maybe you want to create this pair as one column in script that you dont have to use a calculated dimension.

regards

tim

View solution in original post

Surya
Creator II
Creator II

Hello.,

In data model for example you have a table 

fields x and y

load x, y

x & y as pair   //make this new field

from path;

do reload

take stright table 

dimesion x and y

expression --> =count(pair)

---------------------------------------------------------------

directly do in front end 

take stright table 

dimesion x and y

expression --> =count(x & y)

----------------------------------------------------------------

Based on your requirement do as you can best

 

View solution in original post

3 Replies
zhadrakas
Specialist II
Specialist II

Hello,

are this two field your datamodel like "x" and "y"?

if so first approach could be a table with

dimension:  =x&y

expression: count(x&y)

maybe you want to create this pair as one column in script that you dont have to use a calculated dimension.

regards

tim

Surya
Creator II
Creator II

Hello.,

In data model for example you have a table 

fields x and y

load x, y

x & y as pair   //make this new field

from path;

do reload

take stright table 

dimesion x and y

expression --> =count(pair)

---------------------------------------------------------------

directly do in front end 

take stright table 

dimesion x and y

expression --> =count(x & y)

----------------------------------------------------------------

Based on your requirement do as you can best

 

snowman
Contributor III
Contributor III
Author

Thank you both. Have been dragging in finding the right expression like Count() and Aggr(), but haven't thought of your advised one. Precise and concise !
Will use it as the 3rd dimension for the bubble size of the Scatter Chart.