6 Replies Latest reply on Nov 6, 2012 6:12 PM by Anna Chan

blending aggregate and non aggregate fields on an IFF and running sum formula

HI

I am trying to have an if statement be if Days to Release is greeter than Days (Days is the parameter) then show the running sum (a table calculation) , otherwise show another value... I am trying to write the formula but it says i cannot mix aggregate and non aggregate arguments to function. Any insight on this?

Thanks,

Anna

• 1. Re: blending aggregate and non aggregate fields on an IFF and running sum formula

I don't know what Plan A or Plan B  are, but does attr(Days to Release] work?

• 2. Re: blending aggregate and non aggregate fields on an IFF and running sum formula

Hi Alex -

I have attached a workbook. Basically, Actual, and Plan A are static values which will never change, they are lines plotted on the graph. Plan B is the line i want to be able to dynamically manipulate in Tableau via parameters. So if a user choses to increase any of the 8 parameters by a certain percent it will change the line. BUT i want the change in Plan B to occur ONLY after a certain date (ie the date parameter selected ) I am trying to write a calculated field which will say something like this, IF reference date is greater than actual date then apply the formula for plan B, otherwise keep the values at Plan A

• 3. Re: blending aggregate and non aggregate fields on an IFF and running sum formula

Two calcs, one to convert days to release to a number (at the moment it's D34, D56, etc.):

int(right([Days to Release],len([Days to Release])-1))

Then use this calc and attr and your calc above:

if [Parameters].[Days to Release]>attr([Days to release (number)]) then  attr([PlanA]) else RUNNING_SUM(SUM([PlanB]))+2111603 end

Don't know if this gives you the expected result, but it works

1 of 1 people found this helpful
• 4. Re: blending aggregate and non aggregate fields on an IFF and running sum formula

Hi Alex-

Thanks for the advice, it worked wonders on the dashboard. But i am having problems with the final running sum. It should adjust and auto calculate based on the days to release formula. If Days to Release (parameter ) is less than Days to release then values less than days to release should equal Plan A. If Days to Release (parameter) is greater than days to release then all values have a running sum of calculated field B1. The final running sum SHOULD be different because the date to start calculating the calculated field of B1 differs, but i cant seem to get that to happen. Any help would be AMAZING.

Thanks,

Anna

• 5. Re: blending aggregate and non aggregate fields on an IFF and running sum formula

I guess I don't really understand what you need. B changes so little that honestly the running sum looks like it's doing nothing.

• 6. Re: blending aggregate and non aggregate fields on an IFF and running sum formula

Attached is what i meant to accomplish, where the days to release impacts the final sum of the equation, but is it possible to have all values before the parameter not show up... aka there would only be a line for 14 days and less, otherwise there would show no value instead of showing values