Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

complex set analysis

Dear all,

I would like to do the following. I have machines that follow certain maintenance cycles:

MachineCycle
A3
B2
B3
B3
C3
D2
D3
E3
F2
F3
G3

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)
23
38
TOTAL7

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)
23
34
TOTAL7

How can I achive this?

Thanks for any help...

Peter (desperate)

3 Replies
MVP
MVP

Re: complex set analysis

if I understand

1.png

Not applicable

Re: complex set analysis

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

MVP
MVP

Re: complex set analysis

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

Community Browser