Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
My scenaria is, I have two table with 2 column in each table.
table 1 having columns, id and production
table 2 having columns, id and actual production
and my requirment is, if my production value in table 1 is zero or - then fetch this value from table 2 from actual production column..
Could any one plz help me for this.
Thanks and Regards,
Vishal Waghole
Hi,
Try this.
Table1:
LOAD Id,
production
FROM
D:\Community\test116A.xls
(biff, embedded labels, table is [table1$]);
Left Join(Table1)
LOAD Id,
[actual production]
FROM
D:\Community\test116A.xls
(biff, embedded labels, table is [table2$]);
Table2:
Load Id as ID,if(IsNull(production) or production = 0 or production = '-',[actual production],production) as production,[actual production] Resident Table1;
Drop table Table1;
Regards,
Kaushik Solanki
Hi,
Try this.
Table1:
LOAD Id,
production
FROM
D:\Community\test116A.xls
(biff, embedded labels, table is [table1$]);
Left Join(Table1)
LOAD Id,
[actual production]
FROM
D:\Community\test116A.xls
(biff, embedded labels, table is [table2$]);
Table2:
Load Id as ID,if(IsNull(production) or production = 0 or production = '-',[actual production],production) as production,[actual production] Resident Table1;
Drop table Table1;
Regards,
Kaushik Solanki
see the attached file
Dear,
kindly find the attachment.
hope it will help you.
Thanks,
Mukram
HI, try the below code
Tab1:
LOAD * Inline
[
ID , Production
1,200
2,340
3,
];
Left Join
Tab2:
LOAD * Inline
[
ID , ActualProduction
1,230
3,450
];
NoConcatenate
Result:
LOAD ID , if(len(Production)=0, ActualProduction , Production) as Production
Resident Tab1;
DROP Table Tab1;
//yusuf
You can create a chart with dimension Id and this as expresssion:
=if(production=0 or production='-', [actual production],production)
You can also use a similar expression in your load script:
RESULT:
LOAD *,
if(production=0 or production='-', [actual production],production) as ResultProduction
Resident Table1;
drop table Table1;
Hi .
Check this.. Its might not be optimized solution.. But its will solve ur problem.
Karthik
Thank You kaushik
Its working fine...