Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
simonB2020
Creator
Creator

Linking 2 Alternate States

I have a fact table representing 'entities' .
Joined to that, many attribute tables.

Now I want to include a parent-child relationship table for the entities.

Effectively, the user should be bale to select Parent entity 'A' and see all of it's attributes, 
then also see all A's children entities and their attributes.

So I am wondering how best  to duplicate all my entities, so that I have a Parent set, and a Child set.
Link the 2 sets with the relationship map table.

First thought was to duplicate all the tables in the load editor.
Then I was drawn to 'Alternate States' ... but struggling to understand how I could link State 'parent' to State 'child' ?

I got thus far : 

Crated a table with Dimension  'entity_name'
Then measure :   

=count( {<entity_id=$::child_entity_nid>} 1)

This works ONLY if I explicitly select  [child_entity_nid]  values ... but not if implicit.

Appreciate any pointers, 

Thanks.
 

Labels (1)
1 Reply
chrismarlow
Specialist II
Specialist II

Hi,

Instead of alternate states have you looked at using P() function? So using toy app script below I think this shows the kind of effect you are looking for;

 20210624_1.png

Cheers,

Chris.

 

parentchild:
Load * inline [
Parent, Child
, A
A, B
A, C
, D
D, E
];

staticdata:
load * Inline [
Child, Attribute
A, 1
B, 2
C, 3
D, 4
E, 5
];