4 Replies Latest reply on Apr 4, 2012 9:50 AM by Emily Mueller

# Paramater result of calculated field

I have a paramater set up for a workbook that I am working on.  However I cannot create a paramater result calculation with a calculated measure that I created.   I'm assuming there is some kind of workaround for this.

My calculated field is called Processed per day:

sum(p1delwt)/countd(date)

My paramater is year, so I am trying to create the following paramater calculation:

If(Year)=Year Paramater then Processed per day end

I get the error message "cannot mix aggregate and non-aggregate comparisons in 'IF' expressions, so it won't allow me to create the calculated field.

My paramater calculation to return p1delwt works.

I have attached a copy of the workbook. Any help would be greatly appreciated.

Thanks!

• ###### 1. Re: Paramater result of calculated field

You need to post a tbwx which includes the data for us to open the workbook. However, I think I can answer your problem. Your initial calculation is aggregated - kind of like putting a single total value at the bottom of an excel column - your second one is not - for every value of row and year, it's trying to put a value.

Assuming you have your viz set up correctly, then:

If attr(Year)=Year Paramater then Processed per day end

should work. However, that makes some assumptions about what you want the calculation to do.

• ###### 2. Re: Paramater result of calculated field

Sorry, I thought it was a tbwx.  I have attached it again.

It now lets me create the paramater calculation, but no results show up when I put that calculation on the view.

Thanks for looking at this!

• ###### 3. Re: Paramater result of calculated field

Hi Emily,

The calculation is correct, however, since the attribute is being used with Year in Calculation1, it needs to reference something to return a result. Simply place YEAR(Date) on your Level of Detail shelf, and your values will appear.

Hope this helps!

-Tracy

1 of 1 people found this helpful
• ###### 4. Re: Paramater result of calculated field

Hi Tracy-

Thanks for the help!  It worked!

Emily