Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Please help in distinct count

I have a data like this

    BU, Supplier

    A, a

    A, b

    A, c

    B, a

    B, d

    B, e

    B, f

    C, d

    C, a

    C, f

I want to show the number of common supplier in BUs

and I want to achieve this.

Is it possible in Qlikview?

BUABC
A
B1
C12
1 Solution

Accepted Solutions
MVP
MVP

Re: Please help in distinct count

Here is another option.

8 Replies
MVP & Luminary
MVP & Luminary

Re: Please help in distinct count

See attached example.


talk is cheap, supply exceeds demand
MVP
MVP

Re: Please help in distinct count

Here is another option.

MVP & Luminary
MVP & Luminary

Re: Please help in distinct count

Follows? That's a new one for me. I can't seem to find it in the help file either. Can you explain to me how it works?


talk is cheap, supply exceeds demand
MVP
MVP

Re: Please help in distinct count

Its new to me too, so I looked in the reference manual, and it is indeed there (follows and precedes). They are relational operators:

precedes  ASCII less than

Unlike the < operator no attempt is made to make a numeric interpretation

of the argument values before the comparison. The operation

returns true if the value to the left of the operator has a text

representation which, in ASCII comparison, comes before the text

representation of the value on the right.

follows  ASCII greater than

Unlike the > operator no attempt is made to make a numeric interpretation

of the argument values before the comparison. The operation

returns true if the value to the left of the operator has a text

representation which, in ASCII comparison, comes after the text

representation of the value on the right.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Please help in distinct count

Thanks a lot.

swuehl‌ and gwassenaar‌ both seems right.

MVP & Luminary
MVP & Luminary

Re: Please help in distinct count

Thanks! That certainly helps me understanding how Stefan's solution works. It seems very dependent on the sorting though, so it might not work in many other cases.


talk is cheap, supply exceeds demand
MVP
MVP

Re: Please help in distinct count

I haven't intended to confuse anybody.

I think the main difference is within the script / data model. A simple Count(Distinct Supplier) should return correct values in the chart.

The additional if() Statement with the Follows Operator is just cosmetics, to resemble the look & feel of the OP's chart, showing only lower half of values.

Maybe I just shouldn't have used it in my example (and Gysbert is right, it may not work out under all (sort) conditions),

I just want to use these operators once in a while.

MVP & Luminary
MVP & Luminary

Re: Please help in distinct count

Oh, don't worry about confusing us. I learned something new today, so thank you for that!.


talk is cheap, supply exceeds demand