Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner
Partner

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.
Digital Support
Digital Support

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.