Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm facing the following problem with set expression:
I want to have a table like this:
node_id | Count |
1 | 2 |
2 | 3 |
3 | 1 |
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:
CustomerID | CurrentStage |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 1 |
5 | 2 |
6 | 2 |
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!
In a table object with a dimension of node_id, use this as your measure:
aggr(count(if(CurrentStage=node_id,CustomerID)), node_id)
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
];
In a table object with a dimension of node_id, use this as your measure:
aggr(count(if(CurrentStage=node_id,CustomerID)), node_id)
Dim:
CurrentStage
Exp:
Count({<CurrentStage=p(node_id)>}CustomerID)
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)
awesome! thank you very much! :))