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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Decimal number converted to integer

Hello everyone

I'm having a strange situation that can't solve.

First of all, here's the code

tmpTable3:

LOAD

     eMediana as bulkInsert --> Here I'm loading a single number, with decimals

Resident tmpTable2

where mes = 1;

LET vBulkInsert = Num(Peek('bulkInsert')); --> Here i'm storing that number into a variable

DROP Table tmpTable3;

tmpTable4:

NoConcatenate

LOAD *

Resident tmpTable2; --> Loading more stuff

Join

LOAD  --> Adding a single line by hand, using the number stored earlier ion variable vBulkInsert

13 as mes,

$(vBulkInsert) as eMediana

AutoGenerate(1);

Now this is what I get.

If I print the data stored in the variable into a text object, I get the correct number. No problem here.

But, when I use the number stored in eMediana from mes 13 from the table tmpTable4, I get the same number, bit with no comma, so all the decimals became an integer number.


I have been trying to solve with number formatting, commas and dots as decimasl o thousands delimiter, but with no success.


Any help will be preciated


Regards

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Found what I was doing wrong.

I was using variables in a wrong way. I use $(vMaxDate) instead of '$(vMaxDate)'

Adding quotes worked fine.


Thanks all fro your help!

View solution in original post

5 Replies
Anil_Babu_Samineni

May be load with num function

Num($(vBulkInsert), '#,##,00') as eMediana

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jonathandienst
Partner - Champion III
Partner - Champion III

>>with no comma, so all the decimals became an integer number.

You mean that, for example 7,12 (decimal comma) becomes 712?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks for your help Anil. I tried what you said, but as a result I get zero (0.00) in table.

Anonymous
Not applicable
Author

That's right. That's exactlly what is happening. But only when loading variable content (the number here is ok) to the table (the result is the same number but with no comma, as an integer)

Anonymous
Not applicable
Author

Found what I was doing wrong.

I was using variables in a wrong way. I use $(vMaxDate) instead of '$(vMaxDate)'

Adding quotes worked fine.


Thanks all fro your help!