Working with negative varchar values when the minus sign is on the right sideArticle Number: 000047402 | Last Modified: 2019/01/17
Qlik Sense February 2018 attempts to read negative varchar values when the minus sign is on the right side of the value then results as 0 ( such as 50.10- )
Converting the above value to a negative numeric value such as (-50.10) makes Qlik Sense identify the correct data type as numeric.
The key conclusion here is that Qlik Sense Feb 2018 is not able to work with negative nvarchar values with minus on the right. The data type will need to be enforced and converted to numeric as part of the SELECT statement.
As below example:
If NegativeNumeric is varchar(100) such as '50.10-'
NegativeNumeric is the selected field
Convert it in your select statement:
SELECT TOP 1 Amount1, Amount2 FROM TableName;
SELECT TOP 1 (-1)*CAST(SUBSTRING(Amount1,1,CHARINDEX('-',Amount1)-1) AS numeric(18,2)) AS Amount1,
(-1)*CAST(SUBSTRING(Amount2 ,1,CHARINDEX('-',Amount2 )-1) AS numeric(18,2)) AS Amount2
Have a Question?
Search Qlik's Support Knowledge database or request assisted support for highly complex issues.Submit a case
Experiencing a serious issue, please contact us by phone. View phone numbers and hours by region.