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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Check if a value exists in a column

Hello,

I am using the OSUser() function to determine whether a user can see specific objects in my QV app. I have an inline script loading a field called SupervisorNTName which contains the AD account names for Supervisors that I want to be able to see specific objects, whereas others cannot.

How can I write a conditional statement that checks whether the current OSUser() value exists within the SupervisorNTName column?

Thanks,

Sal

4 Replies
Nicole-Smith

Something like the following should work:

if(match(OSUser(), $(=concat(distinct chr(39) & SupervisorNTName & chr(39),','))), 1, 0)

Explanation: match() checks if OSUser() is in any of the values returned by the concat() function.

Not applicable
Author

Hi Nicole,

How can I modify that expression to work regardless of what values are selected for SupervisorNTName?

Nicole-Smith

You can add a 1 to the set analysis to tell it to ignore all selections:

if(match(OSUser(), $(=concat({1}distinct chr(39) & SupervisorNTName & chr(39),','))), 1, 0)

hytown2000
Partner - Contributor III
Partner - Contributor III

I just did something very similar, there is a simple way to check if value exists in a field or not, FieldIndex(OSUser, SupervisorNTName), if exists, it returns the load order, else returns 0. You may need to remove the domain from OSUser().