Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I would like to do the following. I have machines that follow certain maintenance cycles:
Machine | Cycle |
---|---|
A | 3 |
B | 2 |
B | 3 |
B | 3 |
C | 3 |
D | 2 |
D | 3 |
E | 3 |
F | 2 |
F | 3 |
G | 3 |
That means I have 3 machines that have cycle 2 and 3, and 4 machines that have only cycle 3.
If I do =count(DISTINCT Maschine) with Dimension Cycle I something like this:
Cycle | =count(DISTINCT Maschine) |
---|---|
2 | 3 |
3 | 8 |
TOTAL | 7 |
But I would like to have that the machines are counted, that have cycle 2 and 3 and machines that have only cycle 3.
So my table should look like:
Cycle | =count(??????? Maschine) |
---|---|
2 | 3 |
3 | 4 |
TOTAL | 7 |
How can I achive this?
Thanks for any help...
Peter (desperate)
if I understand
Thanks, Massimo.
I only have the personal edition, so I can't open the example.
But I found out. I have to use the aggr() function:
=aggr(min(Cycle),Machine) as new Dimension... worked.
Peter
script
a:
LOAD Machine,
Cycle
FROM
[http://community.qlik.com/thread/150297]
(html, codepage is 1252, embedded labels, table is @1);
left join (a)
load
Machine,
Concat(DISTINCT Cycle, '-', Cycle) as CycleGroup
Resident a
Group by Machine
;
chart is CycleGroup and count distinct