Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

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

Tags (1)
1 Solution

Accepted Solutions

Re: Displaying a number as a proportion please help.

6 Replies
Not applicable

Re: Displaying a number as a proportion please help.

use text object with following code may this helps you

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

Re: Displaying a number as a proportion please help.

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

Re: Displaying a number as a proportion please help.

MVP
MVP

Re: Displaying a number as a proportion please help.

see attachement

1.png

Not applicable

Re: Displaying a number as a proportion please help.

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.

MVP
MVP

Re: Displaying a number as a proportion please help.

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

Community Browser