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

Number formatting in Partial Sums

Hi, I saw a webpage teaching how to customize Qlikview Subtotal. However, I had a problem changing the number format. Let's look at this example:

a.jpg

There are 12 players in the game. Some players earn 1-point and some earn 0.5 point.

And in each sub-total, I want to calculate the total no. of players  and total points the players earned.

Let's say I want the subtotal in country level, "No. of Players in Country" and "Total Points in Country" (as shown on the graph above)

To do this,

First, I created a dimension called "No. of Players in Country"

Then, I checked the Partial Sums and rename as "Total Points in Country"

Finally, in the Expression, to make a correct calculation of "Total Points in Country", I use:

if(Dimensionality()=1, count({<PlayerType={'1-Point'}>} ID)+ count({<PlayerType={'0.5-Point'}>} ID)/2, count(ID))

Then, the question comes, I want the whole row of  "Total Points in Country" presented as 1 decimal point place. e.g. 0 --> 0.0, 1-->1.0

When I tried:

if(Dimensionality()=1, num(count({<PlayerType={'1-Point'}>} ID)+ count({<PlayerType={'0.5-Point'}>} ID)/2,'###0.0'), count(ID))

it doesn't work. (See graph shown below)

b.jpg

Hope someone could help. Thanks.

12 Replies
Siva_Sankar
Master II
Master II

In the presentation tab, under number format settings, click 'Fixed To' 1 decimals. Regards, Sivasankar

Not applicable
Author

Thanks for reply but I don't understand. Let me explain by graph.

c.jpg

The number format in red is what I want to show in the pivot table.

Not applicable
Author

d.jpg

I can't find the number format settings in presentation tab.

Not applicable
Author

I tired many combinaions of code in set analysis these days,

I found that dimensionality() works really well on calculations, but totally messed up on the number formatting.

amars
Specialist
Specialist

Change it in Expressions Text Color Settings

Color change.JPG

Thanks

Not applicable
Author

Thanks for answering.

Do you know how to change the partial sum in the number format 0.0 instead of 0?

In general, I can type num(player, '###0.0') to change the number format.

However, I can't apply the formula on subtotal,

and I tried to use dimensionality(), but the number format of some data is wrong.

amars
Specialist
Specialist

Hi

please check the attachec file.

if(Dimensionality()=1, Num(count({<PlayerType={'1-Point'}>} ID)+ count({<PlayerType={'0.5-Point'}>} ID)/2,'###0.0'), count(ID))

Not applicable
Author

I tried this formula, but it gives me the same result.

amars
Specialist
Specialist

check the attached file above, it is working .