Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
NareshGuntur
Partner - Specialist
Partner - Specialist

Count by Dimension

Hi,

Don't mind if it is too simple.

LOAD * Inline [

A, B, C

a1, b1, c1

a2, b2, c2

a3, b3, c3

a4, b4, c4

a4, b5, c5

a1, b6, c6

a2, b7, c7

a3, b8, c8

];

I have a table like above and I need a chart with A & B as dimensions

I need the below output.

I want (3rd column)the count of C aggregated at A irrespective of B so that I can (4th column)count the % of B according to the total values of A

   

ABCount C at Level ACount B
a1b120.5
a1b620.5
a2b220.5
a2b720.5
a3b320.5
a3b820.5
a4b420.5
a4b520.5

Cheers,

Naresh

1 Solution

Accepted Solutions
tresesco
MVP
MVP

PFA

Dim1:A

Dim2:B

Exp1: Count(Total <A> C)

Exp2: Count(C)/ Count(Total <A> C)

View solution in original post

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Use this expression:

Count(C) / Count(Total <B> C)

Count(C) / Count(Total <A> C)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tresesco
MVP
MVP

PFA

Dim1:A

Dim2:B

Exp1: Count(Total <A> C)

Exp2: Count(C)/ Count(Total <A> C)

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Hi Jonathan,

Thanks for the prompt reply.

It doesn't give any result.

Just a null.

Cheers,

Naresh

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Thanks Tresesco.

It worked like a charm.

Cheers,

Naresh

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

Hi Tresesco,

Can we use Set Analysis in this expression?

Cheers,

Naresh

tresesco
MVP
MVP

You can use set analysis with aggregation functions. But you have to specify the purpose why/how you want that. Otherwise, set analysis would not be an ideal one with the requirement you mentioned above.

NareshGuntur
Partner - Specialist
Partner - Specialist
Author

I want to use it for a specific date. I wonder if I can add this in set analysis along with this.