Nithyanandam G
Nithyanandam G

Reputation: 61

Convert number to decimal in pentaho

In pentaho,i am facing convertion problem when insert the data from selected values. I need to be able to pick up whatever is in that field "as is" and not change it at all.

example

Field - 0.13
inserted field -0

0.13 is converted to 0 but it should be 0.13 only. where as 110 is converted to 110 correctly. Issue with the decimal values, all decimal values converted to 0.

Thanks

Upvotes: 1

Views: 8625

Answers (2)

4nd1
4nd1

Reputation: 1

In "foreign" Countries ( with e.g. SQLite ) these two steps might help:

1st: in the select statement of "Table input" replace the field (e.g. TRANSAMOUNT ) with field*1.0 field (e.g. TRANSAMOUNT *1.0 TRANSAMOUNT ), so every value will be casted implicitly and

2nd: in the Meta-data Tab ( as mentioned below ) change the Type to Number and choose the appropriate "Date Locate" ( e.g. de_DE ) which also affects Numbers ..

Upvotes: 0

Cristian Curti
Cristian Curti

Reputation: 1054

There are a few things you can check on the Select Values.

Decimal Field - This checks which is the sign for decimal value for this number, it uses your system Decimal value, so if you are using English Windows/Unix, the default decimal is the dot, where as in other regions it might be the comma.

Always check which, dot or comma, you are receiving for the number before converting.

One quick note as well, Steps AFTER a Group By will receive ANY number with the mask #.#, which is only 1 decimal number after the sign. The data is not lost, it's simply shown with a different mask, be sure to also put that in the select values as well.

The Select Values should look like this for a Number like 0.13 to show as such enter image description here

EDIT: Note that in Precision and Format i have used the same number of zeros after the decimal sign, this will account for a maximum of 5 decimal cases after the sign, as a mask, if you have values with more than 5 decimal cases it will load as such, just not show. enter image description here

Upvotes: 2

Related Questions