Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

selected divided by not selected

Hi Qlikview community

how can I divide the value in a selection by the sum without selection?

See Screenshot: I choose Berlin and receive the value 1540 But I want this selected value divided by their sum total.

In this case like (1540) divided by (1200 +1500 +1540 +1750 +1850).

Thank you!

Best regards,

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Hi Onur,

the problem is that Set Analysis will not work on your expression because it only works on functions like SUM. You have to rewrite your expression to avoid the multiplication outside the SUM function like this:

= 'Totalprice PLAN IST: ' & sum({1} aggr({1} sum({1} [HEL_DATA_Imps mit Defaults] * SAL_OPPORTUNITYLINEITEM_UnitPrice), SAL_OPPORTUNITYLINEITEM_UnitPrice))


This example will calculate the wrong figure in your case I guess. But, it shows how the Set Analysis would work.

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine

View solution in original post

7 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi,

in Set Analysis you find P() for selected and E() for not selected!

Not applicable
Author

Hi Martina,
how would my formula look like? Unfortunately, I dont understand the documentation Tongue Tied

Can you please give me an example? Thank you very much.

Best regards,

Anonymous
Not applicable
Author

It will be something like this:
sum(Revenue)/sum({$<Unit=E({$} Unit)>} Revenue)

kaushalview
Partner - Creator II
Partner - Creator II

Hi

please See attached example

Regards

kaushal Mehta

kaushalview
Partner - Creator II
Partner - Creator II

Hi

See attached example

Regards

Kaushal Mehta

Not applicable
Author

Hello Michael,

unfortunately I cant use the shown example on my final formula.


= sum( aggr(sum([HEL_DATA_Imps mit Defaults]) * (SAL_OPPORTUNITYLINEITEM_UnitPrice), SAL_OPPORTUNITYLINEITEM_UnitPrice))

How should look my final formula and what i have to change ? I tried to transform your example in to mine like this:

= sum( {$<Unit=E({$} Unit)>} aggr(sum( [HEL_DATA_Imps mit Defaults] ) * (SAL_OPPORTUNITYLINEITEM_UnitPrice), SAL_OPPORTUNITYLINEITEM_UnitPrice))

But it didnt work ! What's wrong Indifferent

Thank you very much

Best Regards,

rbecher
MVP
MVP

Hi Onur,

the problem is that Set Analysis will not work on your expression because it only works on functions like SUM. You have to rewrite your expression to avoid the multiplication outside the SUM function like this:

= 'Totalprice PLAN IST: ' & sum({1} aggr({1} sum({1} [HEL_DATA_Imps mit Defaults] * SAL_OPPORTUNITYLINEITEM_UnitPrice), SAL_OPPORTUNITYLINEITEM_UnitPrice))


This example will calculate the wrong figure in your case I guess. But, it shows how the Set Analysis would work.

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine