Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning,
i've got a table like:
TABLE1:
CODE,
VALUE,
TYPE;
in this table i have a code (90000) that's zero.
I would like to give a value like:
if(code='90000' , sum({<TYPE='E'>}VALUE), sum(VALUE)) as VALUE;
How can i do it?
it's because I didn't understand the request.
Maye be this its OK :
TABLE1:
LOAD * INLINE [
CODE, VALUE, TYPE,YEAR
1, 10, A,2020
2, 20, E,2020
3, 30, E,2019
4, 40, A,2019
90000, 0, P,2020
90000, 0, P,2019
];
left join
load YEAR,sum(VALUE) as SUM90000 resident TABLE1 where TYPE='E' group by YEAR;
OUTPUT:
noconcatenate
load CODE, if(CODE='90000',SUM90000,VALUE) as VALUE, TYPE,YEAR resident TABLE1;
drop table TABLE1;
output:
Thank you! Now it works 🙂
Sorry for my bad explanation
hi,
Calaf_93,
Mr. Taoufiqu Zarra is right, as per your requirement he gave solution.
even though now you can try Coordinate (Year & Code), then it will give result to you.
ksrinivasan.