Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
After I did some kind of transfarmations using left join and creating flags my table is look like this.
Now am trying to create another flag based on the F1.
Load only first value based on the empno where F1=1
Hi Babi,
I am not sure if i understood you correctly but you can try
Load *
From Table
Where F1= '1';
Hi Babi,
Can you share some sample data or please explain in detail.
Thanks & Regards,
Neha S.
It doesn't work nagaraj that's not my requirement.
My requirement is to create flag for only first value where F1=1
Based on the empno.
Pls suggest
Hi,
F1 is column name from your table
If yes then in script try like
if(F1=1,'true','False') as flag
Regards,
Prashant
Hi Babi,
You can try like-
If(F1='1', EmpNo) as Flag.
And suppress null values in your table/chart.
Thanks & Regards,
Neha S.
Hello Babi,
Could you post sample input and expected output?
Hi,
Like this??
Data:
LOAD * INLINE [
Customer, Typology, PartNumber, TotalAmount
customer1, typology1, 1, "316,032"
customer1, typology1, 4, "231,694"
customer1, typology1, 7, "202,305"
customer1, typology1, 1, "197,223"
customer1, typology2, 4, "163,248"
customer1, typology2, 7, "125,838"
customer1, typology2, 1, "113,576"
customer1, typology2, 4, "103,068"
customer1, typology2, 7, "90,984"
customer1, typology2, 1, "49,840"
customer2, typology1, 4, "65,039"
customer2, typology1, 7, "63,584"
customer2, typology1, 1, "22,121"
customer2, typology1, 4, "8,870"
customer2, typology1, 7, "6,944"
customer2, typology1, 1, "5,321"
customer2, typology2, 4, "5,204"
customer2, typology2, 7, "5,116"
customer2, typology2, 7, "4,211"
customer2, typology2, 1, "2,911"
customer2, typology2, 4, "2,881"
customer2, typology2, 7, 470
];
Final:
LOAD *,
'Level 1' as Flag
Resident Data Where PartNumber=1 ;
Concatenate
LOAD *,
'Level 2' as Flag
Resident Data Where PartNumber=4 ;
Concatenate
LOAD *,
'Level 3' as Flag
Resident Data Where PartNumber=7 ;
DROP Table Data ;
-Nagarjun
Hi,
why are loading same table multiple times??
Instead of that, 1 if - else statement work
Load *,if(PartNumber=1,'Level 1',if(PartNumber=4,'Level 2','Level 3')) as flag from table;
Regards,
Prashant
Can we do dynamically ???