Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

SebastienPreau
New Contributor II

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

 

 

2 Solutions

Accepted Solutions
Partner
Partner

Re: Using OSUser in SetAnalysis

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.
SebastienPreau
New Contributor II

Re: Using OSUser in SetAnalysis

[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 !

 

 

8 Replies
Partner
Partner

Re: Using OSUser in SetAnalysis

what means '=' sign in subfield ?
SebastienPreau
New Contributor II

Re: Using OSUser in SetAnalysis

OSUser returns something as Domain = XXX; Userid = spreau

As i just want spreau, i use subfield

SebastienPreau
New Contributor II

Re: Using OSUser in SetAnalysis

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

Re: Using OSUser in SetAnalysis

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

Re: Using OSUser in SetAnalysis

Capture.PNG

SebastienPreau
New Contributor II

Re: Using OSUser in SetAnalysis

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

Partner
Partner

Re: Using OSUser in SetAnalysis

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.
SebastienPreau
New Contributor II

Re: Using OSUser in SetAnalysis

[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 !