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

Making new Categories and calculationg Ratios

Dear Ladies and Gentlemen,

I've the following problem:

Saler Order NoSales Order Item No
Main Article GroupProductUnitsPriceRegionCountry
1010100110Cars4 Wheels19100.000North AmericaUSA
1010100120Bus40 tons1200.203North AmericaCanada
101222270Bike3 Wheels1001.000.000EMEAFrance
100999910CartSmall1150.00EMEAUK
25558380CartSmall17.00EMEADenmark
56666610CartBIG300410.000APACChina

I've the Main Article Group and the Product as Listboxes.

In a chart my Main Article Group is a Dimension. But the original Main Article Group so calculate by a ratio. E.g.

Cart = Cart + Cart*BIG/Small + 4Wheels/ Total 4 Wheels.

The ratios are different by Regio and by Country.

I've solved this with aggr() and Set Analysis. The Problem is, when I select a Main Article Group in the List boxes or a Product,

the Calculation of the ratio is not correct. - Obviously, after Selection, Qlikview does not have the needed values.

How can I avoid this? How can I still drill down from Main Article Group to a Product?

Thank you for your help.

7 Replies
Not applicable
Author

can anybody help me? it's so urgent.

Thank you in advance.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You probably need to use some combination of set indentifiers {1} and possibly TOTAL keywords to enlarge your set for the ratio calc.

-Rob

Not applicable
Author

Thank you Rob for your answer. Can you please give me an detailed example to better understand?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Post an example qvw and perhaps we can demonstrate. You can scramble your data to protect it.

-Rob

Not applicable
Author

So the major issue is: when selecting an MAG via a Listbox, the calculated MAGs are no longer show properly, as

the values in the ratios are no longer in the dataset (selection).

So the opportunity would be to do the calculation in the script.

The problem is, I need the ratios per month, per year, per geo4, per country. This is acctually the AGGR().

If I'm going to this in the datamodel, how could be the datastructre?

is this the right approach?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I was suggesting using the {1} set identifier like this.

=sum(value) / sum({1} value)

That would make the divisor ignore selections.

-Rob

Not applicable
Author

Hi Rob,

thanks for your answer. I was trying to do this with {1}, but did not succeed.

Were shall I put it?

The divisor is a multiplication.