Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
durgesh22
Creator
Creator

Assigning a String having commas to a Variable

I am assigning a string value having commas to a variable ,but couldn't achieved expected.

set vVar= "Let vColumn = peek('Column', 0,'Config') ";

output which i am getting -->$(vVar) ="Let vColumn = peek('Column'"

 

Expected value is  $(vVar)= "Let vColumn = peek('Column', 0,'Config') ";

Please advise what am i missing here.

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
marcus_sommer

A comma will be always treated as delimiter for a parameter. Therefore it's an expected behaviour - although it would be really desirable to have some logic to mask them.

What's the aim for your approach - why setting a variable-creation within another variable?

- Marcus 

View solution in original post

4 Replies
marcus_sommer

A comma will be always treated as delimiter for a parameter. Therefore it's an expected behaviour - although it would be really desirable to have some logic to mask them.

What's the aim for your approach - why setting a variable-creation within another variable?

- Marcus 

dirk_fischer
Creator
Creator

Hi Durgesh22

for me the code behaves exactly as you expect it. The only unexpected behaviour is, that the variable contains a double hypen after the set statement. But if you execute the variable, it does perfectly what you would expect. In my testdata, the value in the first dataset contains the string PRODUCT1, so everything is fine.

 

Regards

Dirk

 

TestcodeTestcodeLog TestcodeLog Testcode

marcus_sommer

I never tried this before but I could admit that it worked in QlikView, too.

Seems that you have anywhere a small syntax error in your approach. Nevertheless it looked for me more complicated as necessary.

- Marcus

dieterwoestemeier
Contributor II
Contributor II

Try something like this:

set vVar= 'Let vColumn = peek(''Column'', 0,''Config'')';