Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
DarioDella
Contributor
Contributor

Save all the possible values ​​that a user can assume within a column

Hi everyone, I'm new to qlik sense. I have two tables one for access requests and one for accesses.

access requests table:

ID |  Area_| Date|    and other columns

1| X|25-11-2022|

access table:

ID | Area|

1|Y|

1|Z|

I would like that if in the request for access to the desired area (therefore the access request table) the desired area has already been registered in the access table, I would be written "ok" otherwise "no".

Example: user with ID = 1 is requesting access to area X, in the access table the user with ID = 1 already has access to area Y and Z therefore in the access request table in the "Permission" column must be indicated "no".

I have tried this with no success:

=aggr(

if (WildMatch( upper(Area_),=aggr(Concat(distinct Area, ','), UserCode) ), 'ok', 'no')

, UserCode)

Anyone have any suggestions to be able to carry out this task?

Labels (1)
1 Reply
SerhanKaraer
Creator III
Creator III

Hello Dario,

If you have control over script, you can try something like below:

"access table":
LOAD *  INLINE [
ID | Area|
1|Y|
1|Z|
] (delimiter is '|');

"map access table":
mapping load AutoNumberHash128(ID, Area) as %key, 1 as flagAccess resident "access table";

"access requests table":
LOAD *, if(AccessControl > 0, 'ok', 'no') as Permission;
LOAD *, Applymap('map access table', AutoNumberHash128(ID_, Area_), 0) as AccessControl INLINE [
ID_ |  Area_| Date|    and other columns
1| X|25-11-2022|
1| Y|26-11-2022|
] (delimiter is '|');

I hope it solves.