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: 
Not applicable

Displaying a number as a proportion please help.

Hello. I am new to QlikView and I am trying to reproduce a box like the one shown in the picture attached.

First I am not even sure what object I should Use. I have been using text objects and for this one I have a formula as follows.

=Count(if(Program = 'DETECT STOP',1)) / sum(If(Program <> 'DETECT STOP', PartsProduced))

But I get a decimal representation and I want a fraction.

Any help on the object and setting I need to choose or even add/change code would be appreciated.

Proportion.jpg

1 Solution

Accepted Solutions
6 Replies
Not applicable
Author

use text object with following code may this helps you

=Count(if(Program = 'DETECT STOP',1)) &' / '& sum(If(Program <> 'DETECT STOP', PartsProduced))

robert_mika
Master III
Master III

13&318 is not the same as 13/318...

robert_mika
Master III
Master III

maxgro
MVP
MVP

see attachement

1.png

Not applicable
Author

Do you mind pasting the code since I am only using the personal version of Qlikview which does not allow for the opening of other peoples .qvw files.

maxgro
MVP
MVP

script to generate test data

load

  if(match(round(rand()*1),1),'DETECT STOP', '') as Program,

  floor(rand()*10) as PartsProduced

AutoGenerate

  1000;

2 overlapping textbox (layout --> layer), the text is

Breakdowns / Part produced

for the first one

and

=num(Count(if(Program = 'DETECT STOP',1)),'#.##0') &' / '& num(sum(If(Program <> 'DETECT STOP', PartsProduced)),'#.##0')

for the second

I use 2 textbox (top in image); another option could be, with one textbox, to put Breakdown....... in the caption (bottom in image)

1.png