Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
i have an issue in scripting using right function on my values always return negative sign -
My code is
[Code]LOAD @1 as %Key1,
@2 as %Key2,
@3 & '_' & @4 as %Key3,
@3 as %Key4,
@4 as %Key5,
if(index(@5,'-') <> 0 , 0-left(@5,len(@5)-1), @5 ) as [Value In Local Currency not bugged],
if(right(@6,1) = '-' , 0-left(@5,len(@5)-1), @5 ) as [Value In Group Currency bugged ]
FROM .\OHUB_YDCVARHIS_test.CSV (ansi, txt, delimiter is ';', no labels, msq);[/Code]
when i process my file :
9320;01000100;A2;00;716670.00;716670.00;716670.00;716670.00;EUR;EUR;2009003;K4
the result is always negative when i'm using the second formula 😞
Did i do something wrong ? or is this a known bug ?
thx for your replies
if(index(text(@5),'-') <> 0 , 0-left(text(@5),len(text(@5))-1), text(@5) ) as [Value In Local Currency not bugged],
if(right(trim(text(@5)),1) = '-' , 0-left(text(@5),len(text(@5))-1), text(@5) ) as [Value In Group Currency bugged ]
This works if you put Text(@5) instead of just @5