Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rank of dimension not used in chart

Hi,

I am new to QlikView and need some help.

I have a table of

Category 1Category 2
AA-1
AA-2
AA-3
BB-1
BB-2
CC-1
CC-2
CC-2
CC-3
CC-4

For each item of category 2, I want to add a new field what represents the rank of count of Category 1:

Category 1Category 2Rank of Count Category 1
AA-12
AA-22
AA-32
BB-13
BB-23
CC-11
CC-21
CC-21
CC-31
CC-41

So based on the new field, I want to create a pie chart which only shows the count of category 2 of which the rank of count of category 1 is "2".

Any way to do it? Thanks!

3 Replies
sunny_talwar

You can create your new field like this

Table:

LOAD * INLINE [

    Category 1, Category 2

    A, A-1

    A, A-2

    A, A-3

    B, B-1

    B, B-2

    C, C-1

    C, C-2

    C, C-2

    C, C-3

    C, C-4

];


Left Join (Table)

LOAD [Category 1],

Count(DISTINCT [Category 2]) as Count

Resident Table

Group By [Category 1];


FinalTable:

LOAD *,

If([Category 1] <> Previous([Category 1]), RangeSum(Peek('Rank of Count Category 1'), 1), Peek('Rank of Count Category 1')) as [Rank of Count Category 1]

Resident Table

Order By Count desc;


DROP Table Table;

and then use this in field in set analysis like this

=Count({<[Rank of Count Category 1] = {2}>}[Category 2])


Capture.PNG

Anonymous
Not applicable
Author

Thanks for the reply!!

Sorry that I am new to QlikView, I am able generate a straight table like what you shown.  However, how to plot the pie chart with only one dimension?  I tried to create a pie chart with Dimension "Category 2" and use "Count({<[Rank of Count Category 1] = {2}>}[Category 2])" as expression, it doesn't give the correct ranking.  Any idea what I did wrongly? thanks!!

sunny_talwar

Are you looking for the chart like the image above? Does that one look right? If not, can you point out what isn't right?