Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my data table I find some negative amount which I want to convert to positive figures in the loading script
TB:
LOAD BAL_ACCT_CODE,
NOTE,
CLA_CODE,
GROUP_CODE,
YEAR,
MONTH,
if (AMOUNT<0,AMOUNT*-1)as AMOUNT,
BCOD
FROM
[..\QVD\FACT_Table\Trial_Balance.qvd]
(qvd);
My script is as above but line in red does not give desired result. Pls see where there is any error in myscript
Try like below load script but what about that values which are not - ive by your line only -ive values convert to positive
TB:
LOAD
BAL_ACCT_CODE,
NOTE,
CLA_CODE,
GROUP_CODE,
YEAR,
MONTH,
if (AMOUNT < 0, AMOUNT * -1, AMOUNT ) as AMOUNT,
BCOD
FROM
[..\QVD\FACT_Table\Trial_Balance.qvd]
(qvd);
Ex:-
LOAD Amt, if(Amt < 0,Amt * -1,Amt)as AMT;
LOAD * Inline
[
Amt
-2
23
566
-4
-5
];
Hi,
try to use fabs().
Look at the attached application
Regards
ASHFAQ
Try like below load script but what about that values which are not - ive by your line only -ive values convert to positive
TB:
LOAD
BAL_ACCT_CODE,
NOTE,
CLA_CODE,
GROUP_CODE,
YEAR,
MONTH,
if (AMOUNT < 0, AMOUNT * -1, AMOUNT ) as AMOUNT,
BCOD
FROM
[..\QVD\FACT_Table\Trial_Balance.qvd]
(qvd);
Ex:-
LOAD Amt, if(Amt < 0,Amt * -1,Amt)as AMT;
LOAD * Inline
[
Amt
-2
23
566
-4
-5
];
Thanks both of You