Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
venkatbza
Creator
Creator

Group by in script

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

Labels (4)
1 Solution

Accepted Solutions
Taoufiq_Zarra
MVP
MVP

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;
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra
MVP
MVP

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;
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
agigliotti
MVP
MVP

your script looks good to me.
What do you mean with "duplicate records" ??

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it