Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Decimal properties and variables

Hi,

It seems that when I use a varialble with a value set via an inputbox I cannot put in a value with a decimal separator ',' and then use it in an expression the expression fails to calculate.

in script I have

SET DecimalSep=',';

In the input fileld I set the variable to be numeric with two decimals and with a decimalseparator ','. If i enter  the value 12,24 it displays in the field like that but cannot be calculated. If I enter the value 12.24 it will display as 12,24 (as I had defined the setting) but this time it can be calculated.

I then found that perhaps I needed to format the variable when usitn it in the calculation so i tried

1000*Num#($(myVariable), '# ###,#')

having the value 12,24 renders the result in the calculation to 12 000,00 indicating that it skips the last two decimals.

I would like the users to be able to enter a decimal value using ',' as this is more natural for them. how should I go about?

Also does anyone know what the SET DecimalSep=','; is used for if it does not apply to all decimal fields? it seems that any previously created numeric values does not change making the application not so flexible between different countrysettings...?

Thank you for any input

1 Solution

Accepted Solutions
3 Replies
marcus_sommer

Not applicable
Author

Hi Marcus,

This was the link that i had found earlier and tried but not gotten to work. I Now found the problem with it: I had used the $(myVariable) as opposed to just myVariable.

the other problem though with changing the format of all numeric fields from one decimal setting to another, do you know a solution here?

//HS

marcus_sommer

You could try to change the default set statements within the script but I think it wouldn't change the numeric formatings from all fields. Therefore you need to load these numeric fields with a num() statement or change field-formatings within the document properties.

- Marcus