Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

aggregation problem

Hi all

I want to concatenate 2 table for 2 business units and create a dashboard using that info,but my issue is that they calculations are different for 1 measure.

e.g

Business Unit A

Sale = sum(sale)/Total (sale)

Business Unit B

Sale = avg(Sale)

I tried to sum( (sum(sale)/Total (sale)) + avg(sale)) --------it does not work

or avg( (sum(sale)/Total (sale)) + avg(sale)) -----also does not work

How can I go about doing that so that I can have 1 chart/pivot table  for both BUs

Thanking you in advance

5 Replies
MK_QSL
MVP
MVP

Can you provide sample data along with your expected result?

Not applicable
Author

Business Unit A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ProductCityUserSales
CheeseAlonsoBen23
ButterVryburgJon12
MilkFloridaPeter23
BreadFloridaBrian66
RiceAlonsoBen23
ButterOrlandoJon12
MilkFloridaPeter23
BreadFloridaBrian

66

Calculation = avg(Sales) --- lets assume you have a user as a dimesion

Business Unit B

ProductCityUserAmountTrans_Type
RiceAlonsoBen23Sale
SampVryburgJon12Order
MilkFloridaPeter23Order
BreadFloridaBrian66Return
RiceAlonsoBen23Sale
SampOrlandoJon12Sale
MilkFloridaPeter23Order
BreadFloridaBrian66Order

Calc = (sum({<Trans_Type={'Sale'}>}Sale)/sum(Sale)

now I want an average of sale for both BUs on 1 chart/pivot table

MK_QSL
MVP
MVP

Sorry but still having one confusion, What is the difference of Amount for BU A and BU B?

Anonymous
Not applicable
Author

You need to add "source" columns to the concatenated  tables that will point what BU you use in the formula.

And expression might be:

if (Source = 'A')

     sum(sale)/Total (sale)

else avg(Sale)

Anonymous
Not applicable
Author

you need additional one attribute in the table with BU information (A,B). based on this field you can use it in the expression.