Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mariamovasheli
New Contributor III

Aggregation Of Different Collumns

Hello,

I need to Calculate market share of certain station in a district Where it is. So I should Divide station's volume to volume of district where it is.

This is my formula but it doesn't Work Can you Please help me


AGGR(Sum({<Owner={'NeoGas'}, YearMonthMY = {'>=$(vStartDate)<=$(vEndDate)'}>}Volume),StationName)

/

AGGR(Sum({<YearMonthMY = {'>=$(vStartDate)<=$(vEndDate)'}>}Total Volume),District)

6 Replies
agigliotti
Honored Contributor II

Re: Aggregation Of Different Collumns

what chart object are you using to show it ?

are YearMonthMY field and vStartDate and vEndDate variables in the same format ?

try to show them in a text object to be sure about it .

mariamovasheli
New Contributor III

Re: Aggregation Of Different Collumns

AGGR(Sum({<Owner={'NeoGas'}, YearMonthMY = {'>=$(201801)<=$(201805)'}>}Volume),StationName)

/

AGGR(Sum({<YearMonthMY = {'>=$(201801)<=$(201805)'}>}Total Volume),District)


I use skater plot and my problem is not date filed this works but I cant calculate market Share of this particular station Within the district it is situated.

miskin_m
Contributor

Re: Aggregation Of Different Collumns

Hi Mariam,

You can try below expression

sum(AGGR(Sum({<Owner={'NeoGas'}, YearMonthMY = {'>=$(vStartDate)<=$(vEndDate)'}>}Volume),StationName))

/

sum(AGGR(Sum({<YearMonthMY = {'>=$(vStartDate)<=$(vEndDate)'}>}Total Volume),District))


My suggestion is please try one expression at a time and see where exactly this break. If this wont work can you share the sample app


Regards.

agigliotti
Honored Contributor II

Re: Aggregation Of Different Collumns

let's try with this:

AGGR(Sum({<Owner={'NeoGas'}, YearMonthMY = {">=201801<=201805"}>}Volume),StationName)

/

AGGR(Sum({<YearMonthMY = {">=201801<=201805"}>}Total Volume),District)


how can you say the value you get is wrong?

mariamovasheli
New Contributor III

Re: Aggregation Of Different Collumns

Firs part Works perfectly but second part with first one not working.

miskin_m
Contributor

Re: Aggregation Of Different Collumns

will need a sample app to work on the expression

Community Browser