Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Showing table value using a Where FieldName = variable

Hello

This is my scenario:

I have an Employees table that has all User related information in it.

Fields:     %EmployeeID, Emp.FullName

I have a Sales table that has all sales related information in it, that is joined to the Employees table

Fields:     %EmployeeID, Sales.FullName


I have a Finance table that is an island and not connect at all - and it cannot at all be join for any reason.

Fields:     Fin.EmployeeID, Fin.FullName, Fin.Salary



Users who open the QlikView app, are authenticated through LDAP, this verifies them using the data in the Employees table.

A variable called vUserName is set to their name at point of opening the app. (for example - variable = John Doe)

Now the problem:

I need to use a text object to display - to the User who is logged in - their Salary.

Because I am not joined to the employees table, or Sales table - I cannot retrieve the correct salary for John Doe.

I wanted to know if i could somehow get it by doing this:

IF( vUserName = Fin.FullName,Fin.Salary,Null() )

I have the vUserName variable - its set to John Doe,

the Finance table has one row per User, so there is a John Doe in the Fin.FullName field.

How can I get this expression to work?

Any help would be greatly appreciated

Many thanks!

1 Solution

Accepted Solutions
woshua5550
Creator III
Creator III

try this

=Only({<[Fin.FullName]={'$(vUserName)'}>}[Fin.Salary])

View solution in original post

6 Replies
vishsaggi
Champion III
Champion III

So what is happening when you trying to do this?

IF( vUserName = Fin.FullName,Fin.Salary,Null() )



Anil_Babu_Samineni

How you are defining vUserName in overview of variable?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi

It doesn't work

I just get a '-' as a response

Anonymous
Not applicable
Author

vUserName is set like this:

=Only({$<SalesPerson>}SalesPerson)

woshua5550
Creator III
Creator III

try this

=Only({<[Fin.FullName]={'$(vUserName)'}>}[Fin.Salary])

Anonymous
Not applicable
Author

Amazing!!
Thank you!