- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please help , Backend logic to create flag, its urgent please
Hi All
please help with backend logic, its URgent please.
Load * inline [
UID, ACCESS, com, loc, div, id
A,USER,C1,L1,D1,668ea29fae73259dc3f26b93
A,USER,C1,L1,D1,66cd8412615a9782e6d7bb33
A,USER,C1,L1,D1,ALL
A,USER,C1,L1,D1,670505e9f26822d8733eccaf
A,USER,C1,L1,D1,668ea2b47bba6d1bad7ad89c
A,USER,C2,L1,D1,ALL
A,USER,C2,L1,D1,ALL
A,USER,C2,L1,D1,ALL
A,USER,C2,L1,D1,ALL
A,USER,C3,L1,D1,668ea2b47bba6d1bad7ad89c
A,USER,C3,L1,D1,670505e9f26822d8733eccaf
];
UID A and com C1 has ALL as well as other values as well so mark as 1
UID A and com C2 has just "ALL" as values in id field so mark as 0
UID A and com C3 has just non ALL as values in id field so mark as 1
Expected output
User | com | flag |
A | C1 | 1 |
A | C2 | 0 |
A | C3 | 1 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the script I used with your data set:
The assumption that I made was that there was a 6 in every id not containing ALL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Qlik1_User1 one more option is using window functions
Data:
Load *,
if(Window(Count(com),UID,com, id='ALL') = Window(Count(com),UID,com),0,1) as flag
inline [
UID, ACCESS, com, loc, div, id
A,USER,C1,L1,D1,668ea29fae73259dc3f26b93
A,USER,C1,L1,D1,66cd8412615a9782e6d7bb33
A,USER,C1,L1,D1,ALL
A,USER,C1,L1,D1,670505e9f26822d8733eccaf
A,USER,C1,L1,D1,668ea2b47bba6d1bad7ad89c
A,USER,C2,L1,D1,ALL
A,USER,C2,L1,D1,ALL
A,USER,C2,L1,D1,ALL
A,USER,C2,L1,D1,ALL
A,USER,C3,L1,D1,668ea2b47bba6d1bad7ad89c
A,USER,C3,L1,D1,670505e9f26822d8733eccaf
];