Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I have two tables (inline script at the end of the post). "People" is list of persons and sometimes there is TrainerID. Data about Trainers is in the same table.
In visualization layer I would like to get two tables:
1. table just like "People" script table
2. Table with only infomration about Trainer of person that is selected in Table 1. For example TrainersID, Name, and weight.
If there is no selection or the person has no trainer than table 2 should be empty or show data about all trainers.
People:
LOAD * Inline [
ID , Name, Age, Gender, TrainerID,
101, 'Andrew','18','Male','105',
102, 'Luyc','21','Female',,
103, 'Bill','30','Male','107',
104, 'George','27','Male',,
105, 'Alice','17','Female',,
106, 'Ida','24','Female','105',
107, 'Antoine','34','Male',,
108, 'Eve','41','Female',,
109, 'Robert','16','Male','104',
110, 'Michaelle','19','Female',,
];
Bio:
LOAD * Inline [
ID , weight, hight,
101, '67','1.65',
102, '58','1.78',
103, '98','1.99',
104, '76','1.72',
105, '81','1.59',
106, '74','1.68',
107, '79','1.74',
108, '86','1.85',
109, '94','1.87',
110, '88','1.77',
];
try
$(=getSelectedFiled(Trainerid) )
and other columns in second table
OK. My visualization looks like this:
I've created a measure like this:
Only({<ID={"=SubField(GetCurrentSelections(),':',2)"}>}TrainerID) - it works if only one ID is selected but I can accep that.
If I select some ID I get:
So far so good. Now I need to get more details about the trainer. For example the weight. It seems to me that I have to use now nested set expression.
Only({<ID=
P(Only({<ID={"=SubField(GetCurrentSelections(),':',2)"}>}TrainerID))
>} weight)
but I get error:
Do anyone have an idea why P() doesn't work here?