Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Variables with Parameters when the value has a comma ","

cancel
Showing results for 
Search instead for 
Did you mean: 
ValeriyaBartosh
Partner - Contributor III
Partner - Contributor III

Variables with Parameters when the value has a comma ","

Last Update:

Sep 21, 2022 10:07:35 AM

Updated By:

Sue_Macaluso

Created date:

Aug 23, 2019 11:18:38 AM

All we have situations, when parameter has a comma “,”, for example, when we want to use set analysis as parameter. Qlik stops to understand where the first parameters ends and the second starts.

There are two methods how to resolve this problem:

  1. Use REPLACE() function
  2. Use CHR(44) instead of comma

I will show how I do it.

  1. REPLACE

Create variable, determine all necessary parameters, use replace() function for parameter witch potentially could have comma as a parameter value.

clipboard_image_0.png

Use variable as expression, send parameter using delimiter

clipboard_image_1.png

 

  1. CHR()

Create variable, determine parameters

clipboard_image_2.png

 

Create parameters as variables, change commas with chr(44)

clipboard_image_3.png

 

clipboard_image_4.png

Use variable as expression

clipboard_image_5.png

1 – Original variable call does not work

  $(  TON( ,,$(LY))  )

clipboard_image_6.png

2 – Add quotes to use string concatenation. Qlik convert chr(44) to real comma, but now it is a text.

=' $(TON( ,,$(LY)))  '

clipboard_image_7.png

3 – Say “Calculate!”

$(='  $(TON( ,,$(LY)))  '  )

clipboard_image_8.png

 

 

 

Comments
DzmitryYasinski
Contributor
Contributor

Great work! Very useful information!

tkas
Partner - Contributor
Partner - Contributor

I FAILED TO UNDERSTAND  THIS EXPRESSION. WHAT IS $1,$2,$3 IN THIS EXPRESSION???

@ValeriyaBartosh 

clipboard_image_0.png

ValeriyaBartosh
Partner - Contributor III
Partner - Contributor III

@tkas these are parameters 

for examptle, see the pic below, $1 =sum, $2=    is empty, $3 = 1;2 $4 = is empty

ValeriyaBartosh_0-1672387953026.png

 

Version history
Last update:
‎2022-09-21 01:07 PM
Updated by: