Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mrainey18
Contributor

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
Partner
Partner

Re: Variables = to other variables

Maybe

Where NameKey = '$(vKey)'


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

Capture.PNG

View solution in original post

5 Replies
Partner
Partner

Re: Variables = to other variables

Maybe

Where NameKey = '$(vKey)'


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

Capture.PNG

View solution in original post

MVP
MVP

Re: Variables = to other variables

How are the name variables defined?

Maybe try with single quotes around the names:

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

...

Where NameKey = '$(vKey)'

...

mrainey18
Contributor

Re: Variables = to other variables

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.

Partner
Partner

Re: Variables = to other variables

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)

Highlighted
mrainey18
Contributor

Re: Variables = to other variables

Works for me