Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mariamovasheli
Contributor III
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
Partner - Champion
Partner - Champion

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
Contributor III
Contributor III
Author

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
Partner - Creator
Partner - Creator

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
Partner - Champion
Partner - Champion

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
Contributor III
Contributor III
Author

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

miskin_m
Partner - Creator
Partner - Creator

will need a sample app to work on the expression