Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kunal-rai
Contributor
Contributor

Qlikview

if user in multiple groups and we have group priority then how can we remove it from other group based on priority

eg

User table

UserId, Groupid

aaa          ggg

aaa          bbb

ccc           hhh

ccc          bbb

 

priority group tbl

ggg 1

bbb 2

hhh 3

result would be

UserId, Groupid

aaa          ggg

ccc          bbb

How do we achieve ?

 

 

 

 

Labels (2)
2 Replies
lfetensini
Partner - Creator II
Partner - Creator II

You need create a "number" property in your GroupId and get only the MIN. Then the field will have two values: number and text. Like "month" or other "date" fields.

 

T1:
LOAD * Inline [
UserId, GroupId
aaa, ggg
aaa, bbb
ccc, hhh
ccc, bbb
];

Left Join (T1)
LOAD * Inline [
GroupId, Priority
ggg, 1
bbb, 2
hhh, 3
];


Table:
LOAD
 UserId,
 MinString( Dual(GroupId, Priority) ) as GroupId
Resident T1
Group By UserId;

Drop Table T1;

Support your colleagues. Remember to "like" the answers that are helpful to you and flag as "solved" the one that helped you solve. Cheers.
Brett_Bleess
Former Employee
Former Employee

Did the post help you with your use case?  If so, do not forget to return to things and use the Accept as Solution button on the poster's thread to give them credit for the assistance and let other Community Members know things worked.  If you are still trying to sort things out, please leave an update with what you still need.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.