6 Replies Latest reply: Jun 4, 2018 4:05 AM by Miskin Mazgaonkar

# 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.

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

/

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

• ###### 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 .

• ###### 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.

• ###### 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?

• ###### 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.

• ###### Re: Aggregation Of Different Collumns

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

• ###### Re: Aggregation Of Different Collumns

will need a sample app to work on the expression