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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tXMLMap Expression Help

Hi,
this is my input : Mont = 129483948 ( type of Mont is string)
in my out put i need to have this : res =1294839,48 ( type of is BigDecimal )
Thank you for your help.
Labels (2)
5 Replies
Anonymous
Not applicable
Author

In your output (I will call it the "RES" column) you need the following. I am assuming the input row is "row1" and the input column is "MONT"...
row1.MONT!=null ? new BigDecimal(row1.MONT) : null

This checks to see that the MONT value is not null and then converts it to a BigDecimal if it is not null. If it is null, it just sets the output column to null.
Anonymous
Not applicable
Author

Thank you for your response, but me i retrive the input from a xsd scheme like this :

So how to do it ?
Anonymous
Not applicable
Author

after adding your expression i get this error :
0683p000009MCPf.png 0683p000009MCPf.png
Anonymous
Not applicable
Author

It looks like you have a non numeric value in your number (maybe a monetary unit?) or the value is an empty string. If it is the non numeric unit, you will need to remove it. If it is an empty string, you need to filter those from being processed.
For example....
row1.MONT!=null && row1.MONT.trim().compareToIgnoreCase("")!=0 ? new BigDecimal(row1.MONT) : null
Anonymous
Not applicable
Author

Thank you it works.
Regards