Qlik Community

New to Qlik Sense

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

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

connecting tags in qmc with section access in app

Hi all,

I have been trying to connect the tags done in the qmc with the section access in app

and have done the following so far but it keeps giving me unknown error so far every time I am trying to connect with the app

any suggestions what I am doing wrong?

LIB CONNECT TO 'QSR';

LOAD 'USER' AS "ACCESS",
     UserDirectory&'\'&UserId AS USERID;  
[Users]:
SELECT "UserId",
"UserDirectory"
FROM "public"."Users";


INNER JOIN "Users":
LOAD Tag_ID,
User_ID;

[TagUsers]:
SELECT "Tag_ID",
"User_ID"
FROM "public"."TagUsers";

INNER JOIN "TagUsers":
LOAD ID,
Name AS _SERIALNUMBER;

[Tags]:
SELECT "ID",
"Name"
FROM "public"."Tags";

Section Access;

LOAD * Resident "Users";


Load * Inline
[ACCESS,USERID,_SERIALNUMBER
USER,BI\nohas,6159
];

Section Application;

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

thank you for replying I actually was able to find a solution which is

let vQvdRoot='lib://QVDRoot/';
let vQvdSource='lib://QVDSource/';
$(Include='$(vQvdSource)ConsumeAppLoadInit.txt');


LIB CONNECT TO 'QSR';
[UserSecurity]:
LOAD Upper('USER') as ACCESS, Upper(UserDirectory & '\' & UserId) as USERID, Upper(Name) as _SerialNumber;
SQL Select "T"."Name", "U"."UserId", "U"."UserDirectory"
From "public"."Users" "U"
inner join "public"."TagUsers" "TH" on "U"."ID" = "TH"."User_ID"
inner join "public"."Tags" "T" on "TH"."Tag_ID" = "T"."ID";

Section Access;
Load * Resident UserSecurity;

Section Application;

Star is *;
if NoOfRows('UserSecurity')>0 then
drop table UserSecurity;
end if

$(Include='$(vQvdSource)ConsumeAppLoadInit.txt');


I think the problem was with the txt file has to be entered twice

View solution in original post

2 Replies
Fredrik_Lautrup
Employee
Employee

I have not done this my self but there is a blog post on a similar concept using custom properties

BI Review: Row-level access in Qlik Sense using custom properties in QMC

Not applicable
Author

thank you for replying I actually was able to find a solution which is

let vQvdRoot='lib://QVDRoot/';
let vQvdSource='lib://QVDSource/';
$(Include='$(vQvdSource)ConsumeAppLoadInit.txt');


LIB CONNECT TO 'QSR';
[UserSecurity]:
LOAD Upper('USER') as ACCESS, Upper(UserDirectory & '\' & UserId) as USERID, Upper(Name) as _SerialNumber;
SQL Select "T"."Name", "U"."UserId", "U"."UserDirectory"
From "public"."Users" "U"
inner join "public"."TagUsers" "TH" on "U"."ID" = "TH"."User_ID"
inner join "public"."Tags" "T" on "TH"."Tag_ID" = "T"."ID";

Section Access;
Load * Resident UserSecurity;

Section Application;

Star is *;
if NoOfRows('UserSecurity')>0 then
drop table UserSecurity;
end if

$(Include='$(vQvdSource)ConsumeAppLoadInit.txt');


I think the problem was with the txt file has to be entered twice