Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable with coma or point

Hey,

I have a problem with comas and points. I want to declare a couple of variable like this:

[OG_GH] = 0.505

[UG_GH] = 0.296

And then I want to use these variables in a expression.

Avg ({<Z1V1niO={'>$([UG_GH])'}>*<Z1V1niO={'<$([OG_GH])'}>}[Z1V1niO])

The problem is that in "expression" I need "," and in Skript ".".

What can I do?

Thank you for your help!!!

Eduardo

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

you can try out the replace function in set analysis.

replace('0.505','.',',') -> 0,505

i don't have any data where i could test it right now but I think it should work this way

avg({<Z1V1niO={'>(=replace($([UG_GH]),'.',','))'}>*<Z1V1niO={'<(=replace($([OG_GH]),'.',','))'}>}[Z1V1niO])

regards,

MT

View solution in original post

2 Replies
diegofcaivano
Partner - Creator
Partner - Creator

Hi. If you treat your variables as text, then you should use REPLACE() function. If you are evaluating those values as numbers, use the NUM() and NUM#() functions with the appropiate decimal separators.

To convert the given example, you first need to interpret the dot and then switch it to comma:

NUM(NUM#([OG_GH], '#,##0.0', '.', ','), '#.##0,0', ',', '.')

Hope it helps.

Not applicable
Author

you can try out the replace function in set analysis.

replace('0.505','.',',') -> 0,505

i don't have any data where i could test it right now but I think it should work this way

avg({<Z1V1niO={'>(=replace($([UG_GH]),'.',','))'}>*<Z1V1niO={'<(=replace($([OG_GH]),'.',','))'}>}[Z1V1niO])

regards,

MT