Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
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
Highlighted
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(",", ".") + ')');

View solution in original post

1 Reply
Highlighted
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(",", ".") + ')');

View solution in original post