Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Function in set analysis

Hi,

I'm trying to convert this expression to set analysis:

=count(distinct aggr(only(My_Field),My_Field))

Thanks in advance,

Yair

6 Replies
MVP
MVP

Re: Function in set analysis

Does that give different output than just

Count(Distinct My_field)

I don't see a scope of using set analysis there in your expression. And if you meant how to incorporate set analysis, may be you can use it like:

=count(distinct <Your Set> aggr(only(<Your Set>My_Field),My_Field))

ely_malki
Contributor

Re: Function in set analysis

Hi Yair,

could you provide more information?

what are waiting to obtain ?

Regards,

Ely

Not applicable

Re: Function in set analysis

Hi,

I'm trying to count in the expression number of different values for my field.

Lets say I have this values:

ID      Value

1          Val_1

1          Val_2

2          Val_2

I want the expression to return 2 for ID - 1 and 1 for ID 2

Please don't tell me to put it as expression of count(distinct Value) and id as dimension.

my final expression should be something like:

sum(if (count(distinct aggr(only(My_Field1),My_Field1)) = count(distinct aggr(only(My_Field2),My_Field2)),1)

Thanks,

Yair

MVP
MVP

Re: Function in set analysis

Straight table:

Dim: ID

Exp: Count ( Value)

Not applicable

Re: Function in set analysis

Please see in my replay.

This kind of solution wont help me.

MVP
MVP

Re: Function in set analysis

But how (else) do you expect one expression to return two values? I think your requirement is not at all clear. Please elaborate with sample data and detailed expected results.