5 Replies Latest reply on Sep 27, 2018 10:39 AM by Naveen B

# Calculate running percentage on a fixed level

Hi,

I am trying to calculate running percentage of a running sum  . The denominator is aggregated at a certain level using LOD expression. The error i receive is "Cannot mix aggregate and non-aggregate arguments in this function"

• ###### 1. Re: Calculate running percentage on a fixed level

HI Sidanth,

if you are not using SUM around fixed calculation,  sum(Fixed calcuation)

you need to maintain the aggregated level then only you will get the required O/P

Hope this helps

BR,

NB

• ###### 2. Re: Calculate running percentage on a fixed level

RUNNING_SUM(SUM([RTS covered qty])) /  {FIXED [CCD Dt Bus Sesn Yr Cd],[Prod Cd]:SUM([RTS qty])}

Can you help me here in this calculation?

• ###### 3. Re: Calculate running percentage on a fixed level

Sidhanth;

Make sure you're using the Tableau Forum Search function. You're likely to quickly find answers to questions just like this.

All the best!

• ###### 4. Re: Calculate running percentage on a fixed level

Divide & conquer has always worked best for me! For this calculation:

RUNNING_SUM(SUM([RTS covered qty])) /  {FIXED [CCD Dt Bus Sesn Yr Cd],[Prod Cd]:SUM([RTS qty])}

I'd break it into ~4 parts and make sure all are working properly on your sheet:

SUM_RTS_covered_qty

SUM([RTS covered qty])

RUNNING_SUM_RTS

RUNNING_SUM([SUM_RTS_covered_qty])

FIXED_PORTION

{FIXED [CCD Dt Bus Sesn Yr Cd],[Prod Cd]:[SUM_RTS_covered_qty]}

COMBINED_FORMULA

[RUNNING_SUM_RTS] / [FIXED_PORTION]

By breaking it up, you'll be able to see if there is any part of the (longer) equation that isn't working as expected.

I suspect you may need to add an ATTR, changing your calc to:

RUNNING_SUM(SUM([RTS covered qty])) /  ATTR( {FIXED [CCD Dt Bus Sesn Yr Cd],[Prod Cd]:SUM([RTS qty])} )

• ###### 5. Re: Calculate running percentage on a fixed level

RUNNING_SUM(SUM([RTS covered qty])) /  SUM({FIXED [CCD Dt Bus Sesn Yr Cd],[Prod Cd]:SUM([RTS qty])})

above cal will do