Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
ı need urgent solutions for my below concern
I have 2 table as stated below. I need 3rd coloumn stated as expected result which sum of Codes from table1
I added result in italic. But some of them sum of DK3 from Table 1 , some of them from Dk4.
is it possible to write a expression for cover all fields? ( sum from seperate columns)
The issue is a bit urgent
Thanks
@sunny_talwar
Table1:
DK3 DK4 Total
100 1001 500
101 1010 200
102 1021 300
102 1023 400
Table2:
PL References_Code Expected Result
Income 100;101 700
Expense 1021 300
Provision 1023 400
Script
LOAD *,
IF(DK3='100' or DK3='101',Total,
IF(DK4='1021',Total,
IF(DK4='1023',Total))) AS tempTotal,
IF(DK3='100' or DK3='101','Income',
IF(DK4='1021','Expense',
IF(DK4='1023','Provision'))) AS PL;
Table1:
LOAD * Inline[
DK3,DK4,Total
100,1001,500
101,1010,200
102,1021,300
102,1023,400];
DROP Field Total;
RENAME Field tempTotal TO Total;
EXIT SCRIPT;
Output
Script
LOAD *,
IF(DK3='100' or DK3='101',Total,
IF(DK4='1021',Total,
IF(DK4='1023',Total))) AS tempTotal,
IF(DK3='100' or DK3='101','Income',
IF(DK4='1021','Expense',
IF(DK4='1023','Provision'))) AS PL;
Table1:
LOAD * Inline[
DK3,DK4,Total
100,1001,500
101,1010,200
102,1021,300
102,1023,400];
DROP Field Total;
RENAME Field tempTotal TO Total;
EXIT SCRIPT;
Output
Thanks a lot Peter👍