Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to extract a single value from my table based on the active user of the app. The value I am pulling out is an access code that will limit which sheets in the application the user can see.
I am currently using
=Text(SubField(OsUser(),'=',-1))
to get the active user of the sheet. This is set into the variable 'ActiveUser' in the Data Load Editor.
The data I have imported has this UserID, called 'QSIdPSubject' (I didn't name it) and an [AccessLevel] which is a simple number.
I am trying to use
=only( {1< [QSIdPSubject] ={'$(=$(ActiveUser))'}>} [AccessLevel])
as a variable expression to get the Access Level integer. The Access Level will then be used in the show conditions of each sheet.
I am getting no results from the set expression even though I have manually confirmed the two IDs are identical and Qlik is showing no errors in the formula.
What am I doing wrong?
For anyone else looking at this for a similar problem. I found the solution. I was overcomplicating the set expression. It only needs to be.
=only({1<QSIdPSubject={"$(vActiveUser)"}>} AccessLevel)
Just was using to many parentheses and such. Hope this helps.
Hi @J_Post ,
First thing that I see is that you're using single quotes around the dollar expansion. This is for a string so if you want to resolve the dollar expansion you have to use double quotes.
=only( {1< [QSIdPSubject] ={"$(=$(ActiveUser))"}>} [AccessLevel])
Give that a try
Thanks
Anthony
Hi Anthony,
This got me a little closer. Instead of showing null I get 0 out of the expression which is definitely a step in the right direction.
Could there be an issue with empty space or format? There is visually no difference in the QSIdPSubject and the ActiveUser, but I am still not getting a value returned.
Thanks
For anyone else looking at this for a similar problem. I found the solution. I was overcomplicating the set expression. It only needs to be.
=only({1<QSIdPSubject={"$(vActiveUser)"}>} AccessLevel)
Just was using to many parentheses and such. Hope this helps.