Discussion Board for collaboration related to Creating Analytics for QlikView.
i need an elegant way to format an amount in smallest unit in script to store these data in an csv file.
I have a qvd with fields amount "237,99" and currency "EUR". I must Export these data to an csv file with amount in smalles unit.
It is difficult to Format amounts for Currencies like YPN because these currency have no decimals.
At the moment i used following script:
Num(Replace( Num(Amount, '0,00'),',','')) as Amount_Num,
But there is no Differentiation between Currency EUR and Currency YPN.
I dont think that if - clause is a solution because i assume Performance-disturbing.
Did anybody know how i can solve these Problem?
Many thanks for your help!
Go to Solution.
try like this:
Num( Num#(Amount), '0,00')') as Amount_Num,
according to your filed try like
Multiply the values by 100 before storing them in the csv file.
thanks for your fast answer. I think i dont understand you correctly. Because if i dont Format and multiple by 100 i get as Output:
If i Format and multiple by 100 i get as Output:
Both is wrong. Could you please explain in Detail your solution?
The format you are loading seems a text, so you must format as a number first and then multiply by 100.
What is your decimal seperator???
if it is ,
thanks. That works for JPY but not for EUR.
So now i use the if and your number Format:
if(MixMatch(Currency, 'JPY'), Num( Num#(Amount)), Num(Replace( Num(Amount, '0,00'),',',''))) as Amount_Num,
Thanks for help to all! If anybody knows better solution please let me know.