Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
dmxmikey
Creator
Creator

Count Distinct

I have the following table and would like to count distinct cust-code where #not available is greater than 0, how can i script that?

Products# not available# units impactedcust-code
Tyres01B19086
Tyres01B19097
Tyres01B19098
Tyres01B19099
Tyres01B19100
Tyres01B19121
Tyres01B19122
Tyres01B19126
Tyres01B19127
Tyres01B19134
Tyres01B19135
Tyres01B19143
Tyres01B19162
Tyres01B19163
Tyres01B19184
Tyres01B19211
Tyres01B19213
Tyres01B19220
Tyres01B19228
Tyres11B19092
Tyres11B19129
Tyres11B19132
Tyres11B19133
Tyres11B19136
Tyres11B19147
Tyres11B19158
Tyres11B19188
Tyres11B19203
Tyres11B19204
Tyres21B19084
Tyres21B19096
Tyres21B19112
Tyres21B19187
1 Reply
Ezirraffner
Creator II
Creator II

Hello @dmxmikey,

Try this

1) In data load editor

products:
load * inline [
products;notavailable;units;cust;
Tyres;0;1;B19086;
Tyres;0;1;B19097;
Tyres;0;1;B19098;
Tyres;0;1;B19099;
Tyres;0;1;B19100;
Tyres;0;1;B19121;
Tyres;0;1;B19122;
Tyres;0;1;B19126;
Tyres;0;1;B19127;
Tyres;0;1;B19134;
Tyres;0;1;B19135;
Tyres;0;1;B19143;
Tyres;0;1;B19162;
Tyres;0;1;B19163;
Tyres;0;1;B19184;
Tyres;0;1;B19211;
Tyres;0;1;B19213;
Tyres;0;1;B19220;
Tyres;0;1;B19228;
Tyres;1;1;B19092;
Tyres;1;1;B19129;
Tyres;1;1;B19132;
Tyres;1;1;B19133;
Tyres;1;1;B19136;
Tyres;1;1;B19147;
Tyres;1;1;B19158;
Tyres;1;1;B19188;
Tyres;1;1;B19203;
Tyres;1;1;B19204;
Tyres;2;1;B19084;
Tyres;2;1;B19096;
Tyres;2;1;B19112
] (delimiter is ';');

 

2) In expression 

Count ({<notavailable = {">0"}>}DISTINCT cust)

 

 

Regards,

 

Ezir