Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

Data load based on OSUser

Hi Community,

Could you please help on below issue

Test:
LOAD   Concat(USERID&Flag, ',') as User;
LOAD * INLINE [
USERID, Flag
JOHN.PAUL,1
PAUL.READ,0
LAURE.JO,1
];
 
LET vUser = Peek('User');
 
IF(WILDMATCH(vUser,Upper(SubField(OSUser(), '=', -1))&1)) then   // This condition is not working (I have used couple of ways but no luck CHR(39)&CHR(42)&Upper(SubField(OSUser(), '=', -1)&1&CHR(42)&CHR(39))
LOAD * INLINE [
ID, Name
100,A
101,B
102,C
103,D
];
else
LOAD * INLINE [
ID, Name
104,Z
105,X
106,Y
107,U
];
endif;
 
any other way to work on it ?
Thanks in Advance!
 
 
Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think like this:

Test:
LOAD * INLINE [
USERID
JOHN.PAUL
PAUL.READ
LAURE.JO
ROB
];
 
IF Exists('USERID', Upper(SubField(OSUser(), '\', 2))) then  
LOAD * INLINE [
ID, Name
100,A
101,B
102,C
103,D
];
else
LOAD * INLINE [
ID, Name
104,Z
105,X
106,Y
107,U
];
endif;

You may need to adjust the SubField() depending on the format of your OSUSER(). 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

2 Replies
paulwalker
Creator III
Creator III
Author

Experts need help on it!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think like this:

Test:
LOAD * INLINE [
USERID
JOHN.PAUL
PAUL.READ
LAURE.JO
ROB
];
 
IF Exists('USERID', Upper(SubField(OSUser(), '\', 2))) then  
LOAD * INLINE [
ID, Name
100,A
101,B
102,C
103,D
];
else
LOAD * INLINE [
ID, Name
104,Z
105,X
106,Y
107,U
];
endif;

You may need to adjust the SubField() depending on the format of your OSUSER(). 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com