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: 
mrainey18
Creator
Creator

Variables = to other variables

I'm not sure if I have the syntax right on this:

Let vKey = $(LastName) & ', ' & $(FirstName)

Filter:

Load

     NameKey,

     Min(Sales)          As minSales

Resident Master

Where NameKey = $(vKey)

Group By NameKey;

This is always returning 0 results when I know there is an exact match in the data.

1 Solution

Accepted Solutions
OmarBenSalem

Maybe

Where NameKey = '$(vKey)'


and please, try to debug to see exactly what's happening?

Capture.PNG

View solution in original post

5 Replies
OmarBenSalem

Maybe

Where NameKey = '$(vKey)'


and please, try to debug to see exactly what's happening?

Capture.PNG

swuehl
MVP
MVP

How are the name variables defined?

Maybe try with single quotes around the names:

Let vKey = '$(LastName)' & ', ' & '$(FirstName)';

...

Where NameKey = '$(vKey)'

...

mrainey18
Creator
Creator
Author

This worked thank you.

Where is the documentation that would show this?  I tried looking it up in the community and google but didn't see anything.

OmarBenSalem

well logically; when you do a where condition with a string; and if it was sthing static; I mean like:

where yourField='Something'

not

where yourField=Something

You would surround the Something wih quotes since it's a string.

Same approach with your variable.

Where NameKey = '$(vKey)'


not

Where NameKey = $(vKey)

mrainey18
Creator
Creator
Author

Works for me