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

FieldA = FieldB in Set Analysis

Hi, I'm facing the following problem with set expression:

I want to have a table like this:

node_idCount
12
23
31

 

where node_id is a dimension and Count is a measure like this: 

count( {<CurrentStage=node_id>}CustomerID)

given that the data model looks like:

Customers:

CustomerIDCurrentStage
11
22
33
41
52
62

 

Nodes:

node_id
1
2
3

 

As you can see, the data are not associated (for a reason, so it should stay that way).

Is it possible please to do somehow?

Thanks a lot!

Labels (1)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

In a table object with a dimension of node_id, use this as your measure:

aggr(count(if(CurrentStage=node_id,CustomerID)), node_id)

View solution in original post

5 Replies
Saravanan_Desingh

May be.

Cust:
LOAD * INLINE [
    CustomerID, CurrentStage
    1, 1
    2, 2
    3, 3
    4, 1
    5, 2
    6, 2
];

Node:
LOAD * INLINE [
    node_id
    1
    2
    3
];

 

GaryGiles
Specialist
Specialist

In a table object with a dimension of node_id, use this as your measure:

aggr(count(if(CurrentStage=node_id,CustomerID)), node_id)

Saravanan_Desingh

commQV78.PNG

Dim:

CurrentStage

 

Exp:

Count({<CurrentStage=p(node_id)>}CustomerID)

Zhandos_Shotan
Partner - Creator II
Partner - Creator II

Hi, 

simplest solution is..

Drag and drop Table viz
Add dimension field CurrentStage (you can set label as node_id 😉
Add Measure with expression: Count(CustomerID)

ZuzJsk007
Contributor III
Contributor III
Author

awesome! thank you very much! :))