Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
i need a help in creating a group by expression
below is my table.
Tmp:
load
Salesorder,
Material,
from xyz.qvd;
in that table i need to create a one more column called count of material. so my final out put will be Salesorder,Material,materialcount from the table.
I have created a below script, but it is giving duplicate records. please help me my approach is correct or not.
Tmp:
load
Salesorder,
Material,
count(Material) as materialcount,
from xyz.qvd group by Salesorder,Material;
Thanks,
Venkat
May be :
Tmp:
load
Salesorder,
Material
from xyz.qvd;
output:
noconcatenate
load Salesorder,Material,count(Material) as materialcount resident Tmp group Salesorder,Material;
left join load * resident Tmp;
drop table Tmp;
May be :
Tmp:
load
Salesorder,
Material
from xyz.qvd;
output:
noconcatenate
load Salesorder,Material,count(Material) as materialcount resident Tmp group Salesorder,Material;
left join load * resident Tmp;
drop table Tmp;
your script looks good to me.
What do you mean with "duplicate records" ??