Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

acyrus92
New Contributor II

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
Highlighted
woshua5550
Contributor III

Re: Showing table value using a Where FieldName = variable

try this

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

6 Replies
vishsaggi
Esteemed Contributor III

Re: Showing table value using a Where FieldName = variable

So what is happening when you trying to do this?

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



Re: Showing table value using a Where FieldName = variable

How you are defining vUserName in overview of variable?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
acyrus92
New Contributor II

Re: Showing table value using a Where FieldName = variable

Hi

It doesn't work

I just get a '-' as a response

acyrus92
New Contributor II

Re: Showing table value using a Where FieldName = variable

vUserName is set like this:

=Only({$<SalesPerson>}SalesPerson)

Highlighted
woshua5550
Contributor III

Re: Showing table value using a Where FieldName = variable

try this

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

acyrus92
New Contributor II

Re: Showing table value using a Where FieldName = variable

Amazing!!
Thank you!