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: 
arulsettu
Master III
Master III

showing incorrect count

hi i am doing simple count

count(id) and for ratio count(id)/count(total id)

count(total Id) is incorrect.

in straight table i checked.in properties expression tab if i use Expression as total it showing correct.

how to do this bar chart.

Note: i am using cyclic group in dimension

37 Replies
Anonymous
Not applicable

On the Chart's Dimension Limits tab it has a limit set to only show the Largest 10 values.  If you tick Show Others then the Total shown with match the sum of the numbers below.

arulsettu
Master III
Master III
Author

hi Bill i need to show Top 10 vech

orginal code is

If(Rank(count({<BW_FM_DT_YEAR={$(=max(BW_FM_DT_YEAR))}>}BW_VEH_ID)) <= 10,Count({<BW_FM_DT_YEAR={$(=max(BW_FM_DT_YEAR))}>}BW_VEH_ID))

to find ratio i did like this

If(Rank(count({<BW_FM_DT_YEAR={$(=max(BW_FM_DT_YEAR))}>}BW_VEH_ID)) <= 10,Count({<BW_FM_DT_YEAR={$(=max(BW_FM_DT_YEAR))}>}Total BW_VEH_ID))

jagan
Luminary Alumni
Luminary Alumni

Hi,

Total will take all the values irrespective of dimension limits. 

jagan
Luminary Alumni
Luminary Alumni

Check this file.

Regards,

jagan.

Anonymous
Not applicable

Your Set Analysis is warping the total.  Try removing it :

     If(Rank(count(BW_VEH_ID)) <= 10,Count(BW_VEH_ID))

arulsettu
Master III
Master III
Author

hi Jagan

result shold be like this in bar chart

Make

Count

ratio

Honda

3153

10%

BMW

1360

4%

Mercedes

1657

5%

Mitsubishi

4900

16%

Kia

898

3%

Toyota

8785

28%

Nissan

6753

22%

Hyundai

860

3%

Chevrolet

1606

5%

GMC

1085

3%

Totals

31057

Anonymous
Not applicable

... or maybe more efficient with this Set Analysis :

     Count({<BW_MAKE_DESC = {"=rank(Count(BW_VEH_ID))<= 10"}>} BW_VEH_ID)

MK_QSL
MVP
MVP

Use below

Straight Table

Dimension

BW_MAKE_DESC

Expressions

1)

COUNT({<BW_MAKE_DESC = {"=Rank(COUNT(BW_VEH_ID))<=10"}>}BW_VEH_ID)

Total Mode Select Sum of Rows

2)

COUNT({<BW_MAKE_DESC = {"=Rank(COUNT(BW_VEH_ID))<=10"}>}BW_VEH_ID)/COUNT(TOTAL{<BW_MAKE_DESC = {"=Rank(COUNT(BW_VEH_ID))<=10"}>}BW_VEH_ID)

t_chetirbok
Creator III
Creator III

for ratio use expression

If(Rank(count(BW_VEH_ID), 4, 1) <= 10,

count(BW_VEH_ID)

/sum(TOTAL aggr(If(Rank(count(BW_VEH_ID), 4, 1) <= 10,count(BW_VEH_ID)) ,BW_MAKE_DESC) )

)

sfatoux72
Partner - Specialist
Partner - Specialist

Change this setting for your expression and you will have what you want

2016-03-03 10_38_06-QlikView x64 -Downloads_test.png