Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

SevillaFe
New Contributor

Relative numbers

Hello,

I have a problem with the calculation of relative quotas.
The data e.g. come from two tables:
1. Failed units:
2. Units produced

Calculation (Failed units/produced units) *1000

The problem is that the failed units have some characteristics (Model, color, shape, production factory, ...) (... represents the filters that I use in the dashboard)
The produced units should have the same characteristics and should be chosen automatically with dasboard filters:

then the calculation would be:

Calculation: (Failed units (Model1, color 1, factory 1)/Produced units (Model1, color 1, factory 1)) *1000

Can you help me?

Thank you!

1 Solution

Accepted Solutions
rogerpegler
Contributor

Re: Relative numbers

I'm guessing your two tables have the same characteristics (eg model, color, factory) and values, but in different fields otherwise they would be joined by association.

Assuming you are filtering based on the Failed_Units version of the fields, the following expression may work

Count(Failed_Units) / 

Count({< Model_Produced_Units=p(Model_Failed_Units), Color_Produced_Units=p(Color_Failed_Units), Factory_Produced_Units=p(Factory_Failed_Units)>} Produced_Units)

*1000

 

4 Replies
h_prakash
Contributor

Re: Relative numbers

Hi,

Can you provide a sample data. I am not visualizing how the data is like.

 

Thanks

Prakash

Highlighted
Partner
Partner

Re: Relative numbers

I think seeing the load script, and the actual columns the tables "Failed units" and "Units produced" would help. Can you share it?

rogerpegler
Contributor

Re: Relative numbers

I'm guessing your two tables have the same characteristics (eg model, color, factory) and values, but in different fields otherwise they would be joined by association.

Assuming you are filtering based on the Failed_Units version of the fields, the following expression may work

Count(Failed_Units) / 

Count({< Model_Produced_Units=p(Model_Failed_Units), Color_Produced_Units=p(Color_Failed_Units), Factory_Produced_Units=p(Factory_Failed_Units)>} Produced_Units)

*1000

 

SevillaFe
New Contributor

Re: Relative numbers

Hi!!!

Sorry for my delay...

it works!! Awesome 😀

thank you so much for your Help!!!