Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

%Mix

Hello, i have a pivot table where i need to present %mix, but i have a dimensión Region , some like this, my problem is when i use the expression Sum(TOTAL Aggr(sum({<$(vSetYearAct),$(TipRegion)>}#Sales),CanalName)) for get sum of sales for region show sales for noth and south, not separate

 

RegionNortSouth
Canal NameSales%MixSales%Mix
Canal 1547233%871252%
Canal 2876952%647839%
Canal 3254715%214513%
Total16788100%17335103%
1 Solution

Accepted Solutions
MVP
MVP

Re: %Mix

!

Hi Elina,

you simply had an extra bracket } after the TOTAL qualifier. Attached is the corrected formula.

cheers,

Oleg Troyansky

Learn advanced QlikView and Qlik Sense techniques in my book QlikView Your Business

8 Replies
MVP
MVP

Re: %Mix

Hi Elina,

I don't think you really need the AGGR function for this calculation. I'd use the following:

SUM({<condition>} Sales)/sum({<condition>} Total Sales)

cheers,

Oleg Troyansky

Learn AGGR, Set Analysis, and many other advanced techniques from my book QlikView Your Business.

Not applicable

Re: %Mix

I've already tried that option, but I don't have result. It could be because I have canal and region as dimension??

Highlighted
MVP
MVP

Re: %Mix

It looks like you want the %Mix within the Region? Just need to add <Region> after the total in Oleg's expression, I think.

sum({<$(vSetYearAct),$(TipRegion)>} #Sales)
/sum({<$(vSetYearAct),$(TipRegion)>} total <Region> #Sales)

Not applicable

Re: %Mix

sorry, i don´t explain correctly, i have two dimensions. canal and regional, and i have two variables vSetYearAct and TipRegion, the last save if region is north or south, i tried your expression, but do not work.


(sum({<$(vSetYearAct),$(TipRegion)>}TOTAL <Regional>} #Sales)

MVP
MVP

Re: %Mix

Hi Elina,

it would be a lot easier if you could create a small example and share it. We could then review it and help you find the solution.

cheers,

Oleg Troyansky

Not applicable

Re: %Mix

thannks Oleg, attach file with examples, thanks for your help

MVP
MVP

Re: %Mix

!

Hi Elina,

you simply had an extra bracket } after the TOTAL qualifier. Attached is the corrected formula.

cheers,

Oleg Troyansky

Learn advanced QlikView and Qlik Sense techniques in my book QlikView Your Business

Not applicable

Re: %Mix

Thanks, for your time

Community Browser