Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
elijahabel
New Contributor III

How to Parse OSUser() and store the result in a variable

For our application, we need to be able to retrieve the current user ID so that we can use it to look up data entitlements.

 

Currently, OSUser() is returning "UserDirectory=Directory1; UserId=user234"

 

What expression can I use to store only "user234" in a variable? I'm having trouble finding String manipulation functions that would help solve this problem in Qlik Sense.

 

Thank you in advance! 

Labels (3)
1 Solution

Accepted Solutions

Re: How to Parse OSUser() and store the result in a variable

This might work as well

SubField(OSUser(), '=', -1)
3 Replies
MVP & Luminary
MVP & Luminary

Re: How to Parse OSUser() and store the result in a variable

You could use: subfield(subfield(osuser(), ';', 2), '=', 2)

- Marcus

Re: How to Parse OSUser() and store the result in a variable

This might work as well

SubField(OSUser(), '=', -1)
elijahabel
New Contributor III

Re: How to Parse OSUser() and store the result in a variable

Marking this the correct solution because it is a little cleaner. Thank you, both!