Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Concatenated string variable and Set Analysis

Hello,

I'm having trouble being able to use a variable I have created in my set analysis expression. Please assist. I have tried numerous ways and have not been successful.

Variable Name and Definition:

vFacilityName = concat(DISTINCT chr(34) & "Facility Name" & chr(34),',')

(When I use my variable (i.e. $(vFacilityName) ) as an expression in a text object, it does work.)

However, I'm unable to do so in my set analysis expression:

Attempt 1: count({$<"Facility Name"={'$(=vFacilityName)'}>}distinct Patient_ID)

Attempt 2: count({$<"Facility Name"={'$(vFacilityName)'}>}distinct Patient_ID)

Attempt 3: count({$<"Facility Name"={"$(vFacilityName)"}>}distinct Patient_ID)

Attempt 4: count({$<"Facility Name"={"$(=vFacilityName)"}>}distinct Patient_ID)

And several other attempts and changing syntax.

Please assist this is definitely giving me some trouble.

Thank you.

1 Solution

Accepted Solutions
MVP
MVP

Re: Concatenated string variable and Set Analysis

It may depend on how you defined your variable, with or without a leading equal sign:

vFacilityName


=concat(DISTINCT chr(34) & "Facility Name" & chr(34),',')


Then

count({$<"Facility Name"={'$(vFacilityName)'}>}distinct Patient_ID)


should work, IMO.


Create a straight table chart with this expression and Facility Name as dimension and then hover with the mouse over the expression header. It should show the expression with the variable expanded.

4 Replies
MVP
MVP

Re: Concatenated string variable and Set Analysis

It may depend on how you defined your variable, with or without a leading equal sign:

vFacilityName


=concat(DISTINCT chr(34) & "Facility Name" & chr(34),',')


Then

count({$<"Facility Name"={'$(vFacilityName)'}>}distinct Patient_ID)


should work, IMO.


Create a straight table chart with this expression and Facility Name as dimension and then hover with the mouse over the expression header. It should show the expression with the variable expanded.

Re: Concatenated string variable and Set Analysis

What are the values of facility name

Life is so rich, and we need to respect to the life !!!
Not applicable

Re: Concatenated string variable and Set Analysis

Values of Facility Name field were: Hospital 1, Hospital 2, etc...

Values of Variable were: "Hospital 1", "Hospital 2", etc.

vinieme12
Esteemed Contributor II

Re: Concatenated string variable and Set Analysis

variable

=concat(DISTINCT chr(34) & [Facility Name] & chr(34),',')


Expression

=count({$<[Facility Name]={$(vFacilityName)}>}distinct Patient_ID)

Community Browser