5 Replies Latest reply: Oct 7, 2011 6:37 PM by Rob Wunderlich

# Calculating percentage share of total value

Hello experts,

I'm working on app where I'm suppose to display a table 3 columns

promotion category, number of sales for category and percentage of sales for each category (This will add to 100% for all categories.).

There could be sales that does not belong to any of the promotion categories. There are additional filters to fileter on year, month, region etc.

I was not able to write formula to calculate percentage of sales for each category. Please advice me on this.

Thanks,

krishna

• ###### Calculating percentage share of total value

Krishna,

Try this:

sum(total <promotion_category> sales)/sum(sales).

Regards,

Kiran.

• ###### Calculating percentage share of total value

Thanks Kiran.

Problem with the formula is that when Sum(sales) , this will get all sales including those that does not belong to any category.

I need percentage of sales for each category within the promotion sales only. ( excluding non-promotional sales).

• ###### Calculating percentage share of total value

Hi Krishna,

you could use Set analysis sum(\${<[promotion_category] = {'*category*}>}sales)/sum(sales).

• ###### Calculating percentage share of total value

Add set analysis on promtion category to filter null values {<promotion_category-={''}>}. Actually in my expression numerator and denominator should be interchanged.

Kiran.

• ###### Calculating percentage share of total value

If [Promotion Category] is a dimension in your chart, the expression would be:

sum(Sales) / sum(TOTAL Sales)

-Rob