Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extracting number of categories in a chart

Hi all,

I've been trying for hours now to achieve the following: I have put together a chart with essentially two columns

Col1 Col2 Col3

Key1     A      1

Key2     A      2

Key3     A      3

Key4     B      4

Key5     B      5

Key6     C      6

Col2 is a string, but I need to convert it to a numeric so I can use it in a scatterplot. How can I count the number of unique entries of Col2 in an expression...here the value is 3? Col2 is generated via an expression on its own.

Thanks a lot for your advice,

Florian

1 Solution

Accepted Solutions
sunny_talwar

How about this:

Count(DISTINCT TOTAL Col2)

View solution in original post

4 Replies
sunny_talwar

How can I count the number of unique entries of Col2 in an expression...here the value is 3?

May be this

Count(DISTINCT Col2)

Col2 is generated via an expression on its own.

How is Col2 getting generated? If statement? Can you provide the expression and dimensions for your chart?

Gysbert_Wassenaar

Try count(distinct aggr( ...expression_that_calculates_Col2_here..., Col1))


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Sunny,

I have tried that, but it doesn't seem to work. Col2 can for e.g. have values A-E, so a total of 5. But when I do the count distinct on the above table, I get a 1 back instead of a 3.

Capture.PNG

Best,

Florian

sunny_talwar

How about this:

Count(DISTINCT TOTAL Col2)

View solution in original post