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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with syntax error

Hi,

I’m trying to match NT user with list from a data file

= if (({$<UA.NTUserName = {'$(=Upper(OSUser()))'}) , [UA.Full Name],UA.NTUserName )

Thanks in advance

Lax

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

Here is a sample app

text box expression as follows:

= if ( isnull( only(  {$<UA.NTUserName={'$(= upper(OSUser()))'}>}   [UA.Full Name] ))=-1,'Different User', only(  {$<UA.NTUserName={'$(= upper(OSUser()))'}>}   [UA.Full Name] ))

View solution in original post

9 Replies
JonnyPoole
Former Employee
Former Employee

does this work ?


if ( UA.NTUserName =  Upper(OSUser()) , [UA.Full Name], UA.NTUserName )

Not applicable
Author

Hi Jonathan,

Please see the correct condition

= if (({$<UA.NTUserName = {'$(=Upper(OSUser()))'}) , ,UA.NTUserName )

Thanks

Laxman

Not applicable
Author

No, I'm trying to match OSUSER() with data field values "NTUserName"

JonnyPoole
Former Employee
Former Employee

Ok. Sorry. I reread the post but i'm unclear on the desired outcome.  Can you provide any more description or screenshot of what you want to see ?

Based on what i've read , If the data field value equals the OSuser, you want to display the user name (and hide the rest) ? That would be an expression like this. The else clause evaluates to null() and those values would be hidden by default in a chart .

= if ( UA.NTUserName = Upper(OSUser() )  ,UA.NTUserName )

Not applicable
Author

Hi Jonathan,

Thanks for your response , please find the attached QVW file

Thanks

Laxman

Not applicable
Author

I did the workaround; please find the attached QVW file.

JonnyPoole
Former Employee
Former Employee

Here is a sample app

text box expression as follows:

= if ( isnull( only(  {$<UA.NTUserName={'$(= upper(OSUser()))'}>}   [UA.Full Name] ))=-1,'Different User', only(  {$<UA.NTUserName={'$(= upper(OSUser()))'}>}   [UA.Full Name] ))

Not applicable
Author

Thanks it works ,


so to match data value we need to use “ONLY” function

I’m new to QlikView


Laxman

JonnyPoole
Former Employee
Former Employee

MMore specifically, to use set analysis it needs to be in the context of an aggregation function. 

SInce you looking for only 1 textual value however, only() is the right aggregation function to use .