Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can any one pls help me out -
I have a Table -
ID Scenario Run
1 A 1,2
2 B 1,2,3
3 C 1
4 D 2,3
5 E 1,3
I want to display / filter the data as :
Drop down field with Q1,Q2, Q3.
If Q1 is selected only Run with 1 should display.
If Q2 is selected Run with 1,2 should display
If Q3 is selected Run with 1,2,3 should display.....
What about 2,3 and 1,3?
Is it possible for your data to contain the numbers in a non sorted manner like this 3,1,2 or 2,1?
Try the solution below. I'm assuming you that 1,3 will be associated with q1 and q3. This solutions also handles different sortings such as '3,1,2' and '2,1'.
LOAD ID, Scenario, Run, Run as %quarter FROM Source;
For each _q in FieldValueList ('%quarter')
Quarters:
Load '$(_q)' as %quarter
'Q' & Subfield ('$(_q)' , ',') as Quarter
Autogenerate 1;
Next _q
I have a Table -
ID Scenario Run
1 A 1,2
2 B 1,2,3
3 C 1
4 D 2,3
5 E 1,3
I want to display / filter the data as :
Drop down field with Q1,Q2, Q3.
If Q1 is selected only Run with 1 should display. - Where ever 1 under Run should Display
---> ID - 1,2,3,5 should display
If Q2 is selected Run with 1,2 should display - under Run where ever 1 and 2 values should Display
----> ID - 1,2,4,5 should display
If Q3 is selected Run with 1,2,3 should display.....
---> ID - 1,2,3,4,5 should display
Is it possible for your data to contain the numbers in a non sorted manner like this 3,1,2 or 2,1?
--> Yes
When Q2 is selected it is not displaying the Run column value with only 1.
And also instead of Q1,Q2,Q3 - Q3-2020,Q4-2020,Q1-2021
@Vegar Hey man, any chance you can swing back on this one and have another look at the new posts, sorry the notifications are still messing up too. I am not sure you still have enough info, but I will let you be the judge.
Regards,
Brett
I see, I must have missunderstood your requirements. You could try to run this script instead.
LOAD ID, Scenario, Run, Run as %quarter Inline [
ID;Scenario;Run
1;A;1,2
2;B;1,2,3
3;C;1
4;D;2,3
5;E;1,3
] (delimiter is ';');
For each _q in FieldValueList ('%quarter')
Quarters:
Load '$(_q)' as %quarter,
'Q' & IterNo() as Quarter
Autogenerate 1
WHILE IterNo() <= rangemax($(_q));
Next _q
I hope it will be of help.