4 Replies Latest reply on Mar 28, 2014 2:41 AM by ayaz ahmed

# Easy calculations in 'Dimensions'

Hi, I want to  create a calculation which works out a percentage of the dimension 'was IOFM used'.

For example for April 2013, YES would be 23.52% ( 12/51*100)

How do I create a calculated field which would work this out for me, the problem I have is that 'no', 'yes' , 'no response' are all within one dimension and I cant do a simple calculation in the calculated field section.

I hope someone can help.

Thanks,

A • ###### 1. Re: Easy calculations in 'Dimensions'

I've dealt with this before when the session ID could be repeated, in that case you'd be using a countd instead of count. For that situation one solution is to create a modified [SessionID] for the possible responses. i.e. Yes_ID:

If [Was IOFM used]='Yes' then [Session ID] end

Nulls will be ignored in this count, so you'd get a count if only the yes values. Then

countd([Yes_ID])/countd([SessionID])

would compute the percent of yes responses.

Your case may be simpler, since you are using a count instead. In that case count([SessionID]) will likely give you the same result as Sum([Number of Records]). I recall one day noticing that Number of Records is a computed field, I laughed out loud when I went into the calculation editor to look at the formula:

1

That is it, it is the number one. We could use an idea similar to the one above to flag only the yes responses. Is_Yes

If [Was IOFM used]='Yes' then 1 else 0 end

Then

Sum([Is_Yes])/Sum([Number of Records])

should compute this value as needed.

Please let me know if one of these works for you, If not, please post a sample dataset so I can include a workbook in my response. It doesn't need to be your real data, but if you mock something up with a similar structure in excel would make it a lot easier to help.

Thanks,

N.

• ###### 2. Re: Easy calculations in 'Dimensions'

Thanks Noah,

works perfectly, appreciate the help and quick response.

thanks

A