Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jmvilaplanap
Valued Contributor

SetNumValue with decimals

Hi All,

I´m trying to assign a not integer number (decimal) to a variable in a Qlik Sense extension.

The format of the value is in "spanish format", using "," to separate the decimals. The value is "0,945323".

I tried with SetNumValue and SetStringValue but it doesn´t works.

Anyone knows how to use this function?

Thanks

1 Solution

Accepted Solutions
jmvilaplanap
Valued Contributor

Re: SetNumValue with decimals

I solved, but I´m not proud about the solution, I think it will be another one better than this.

I used the replace function to change the "," by "." and put the value inside =() like a formula or variable and with this is working. But this only will work with "spanish format"

this is the line:

  • qlik.currApp().variable.setStringValue($scope.layout.props.varName, '=(' + $scope.layout.props.varValue.replace(",", ".") + ')');
1 Reply
jmvilaplanap
Valued Contributor

Re: SetNumValue with decimals

I solved, but I´m not proud about the solution, I think it will be another one better than this.

I used the replace function to change the "," by "." and put the value inside =() like a formula or variable and with this is working. But this only will work with "spanish format"

this is the line:

  • qlik.currApp().variable.setStringValue($scope.layout.props.varName, '=(' + $scope.layout.props.varValue.replace(",", ".") + ')');
Community Browser