Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 impacted | cust-code |
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 |
Tyres | 2 | 1 | B19187 |
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