Qlik Community

Ask a Question

New to Qlik Sense

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

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
SebastienPreau
Contributor III
Contributor III

Using OSUser in SetAnalysis

Hello,

We need to use the OSuser in a SetAnalysis in QlikSense September 2018.

So far, we have tried this :

[PERIM_CRCO.TYPE_PERIM]={'PERIM_OPE'},[PERIM_CRCO.C_LOGINAD]={"=upper(subfield(OSuser(),'=',3))"}

or

[PERIM_CRCO.TYPE_PERIM]={'PERIM_OPE'},[PERIM_CRCO.C_LOGINAD]=upper(subfield(OSuser(),'=',3))

but none seems to work.

NB :

=> we do not want to use Security as we want to have several values for PERIM_CRCO.TYPE_PERIM

 

 

Labels (3)
2 Solutions

Accepted Solutions
agigliotti
Partner
Partner

yes could be as you said.
let's try using the below expression in your set analysis:
[PERIM_CRCO.C_LOGINAD] = {"=$(=upper(subfield(OSuser(),'=',3)))"}

I hope it can help.

View solution in original post

SebastienPreau
Contributor III
Contributor III
Author

[PERIM_CRCO.C_LOGINAD] = {"$(=upper(subfield(OSuser(),'=',3)))"}

Works !!!

Thanks.

We are going to test passing it through a variable and if OK, problem solved !

 

 

View solution in original post

8 Replies
agigliotti
Partner
Partner

what means '=' sign in subfield ?
SebastienPreau
Contributor III
Contributor III
Author

OSUser returns something as Domain = XXX; Userid = spreau

As i just want spreau, i use subfield

SebastienPreau
Contributor III
Contributor III
Author

I mean subfield is used to retrieve the third part of the string when cut along the character '='
agigliotti
Partner
Partner

are you sure?
I got "domain\username" pattern as OSUser() output.
SebastienPreau
Contributor III
Contributor III
Author

Capture.PNG

SebastienPreau
Contributor III
Contributor III
Author

I Suppose the pattern may vary depending on the way the server is linked with AD ?

agigliotti
Partner
Partner

yes could be as you said.
let's try using the below expression in your set analysis:
[PERIM_CRCO.C_LOGINAD] = {"=$(=upper(subfield(OSuser(),'=',3)))"}

I hope it can help.

View solution in original post

SebastienPreau
Contributor III
Contributor III
Author

[PERIM_CRCO.C_LOGINAD] = {"$(=upper(subfield(OSuser(),'=',3)))"}

Works !!!

Thanks.

We are going to test passing it through a variable and if OK, problem solved !

 

 

View solution in original post