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

Load data contains the specific value with ID

We required IDs data contains 'Test3', Please refer the sample screenshot below.

compare.JPG

LOAD * INLINE [
ID, Name, Category
1, dsfdsgdfg, Test1
1, dsfdsgdfg, Test2
1, dsfdsgdfg, Test3
1, dsfdsgdfg, Test4
2, bffgtr, Test1
2, bffgtr, Test2
3, gfhtrhtr, Test2
3, gfhtrhtr, Test3
3, gfhtrhtr, Test4
4, nghntnry45, Test2
5, gfngfbw56, Test1
5, gfngfbw56, Test2
5, gfngfbw56, Test3
5, gfngfbw56, Test4
6, jkmtyerea, Test2
6, jkmtyerea, Test3
7, hgjtyurty, Test1
7, hgjtyurty, Test2
7, hgjtyurty, Test4
8, kjljtytr, Test1
8, kjljtytr, Test2
8, kjljtytr, Test4
9, yutrytry, Test3
];

5 Replies
Vegar
MVP
MVP

Test3IDs:
Load ID as Test3ID from source where category = 'Test 3';

Final:
Load ID, Name, Category
From source
where exists(Test3ID, ID);
Drop table Test3IDs;
karan_kn
Creator II
Creator II
Author

Thanks for the response, but I need output exactly like above screenshot, as I'm getting only Test3 data
dplr-rn
Partner - Master III
Partner - Master III

If you follow vegar's method your datamodel will contain only what you desire as output .
please specify if you want the output only on the UI or the full datamodel.
latter is vegars approach.
if you want the former you can modify vegars code and add a flag on all the ids which has Test3

karan_kn
Creator II
Creator II
Author

I need output only on the UI, I mean Pivot table
dplr-rn
Partner - Master III
Partner - Master III

2 options
1- try something like below to creata a flag and use set analysis like Test3Flag={'Y'} in your pivot table
Test3IDs:
Load ID, 'Y' as Test3Flag from source where category = 'Test 3';
2- Option 2 pure set analysis something like below
Sum( {<
ID=p( {<Category={'Test3'}>}ID)
>}
YourMeasure)