cancel
Showing results for 
Search instead for 
Did you mean: 

calculation context

Former Member
0 Kudos

Hi team,

I have created one calculation context :

Let say i have following field in the DP ,

Year,Quarter,state,salesrevenue

and in the block i have the following fields :

Year, state, revenue .

Now i have created one column to calculate the max revenue in the quarter for that year.

I have written the following formula

MAX( [REVENUE] FOREACH [ QUARTER] ) IN ([YEAR]).

but when i execute the report , i am getting the text with the formula.

Pls help me.....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please try to create a variable of type measure and use the formula.

=Max([Sales revenue] ForEach ([Quarter])) In ([Year])

I have attached the screen shot of the output after doing the same.

Kindly let me know if it solved your problem.

Note : I just renamed CalcRevenue2 to CalcRevenue3 as variable name. You can ignore this.

Cheers

Jim

Former Member
0 Kudos

Hi Jim,

Thanks for the input , i will check and let u know.

Can you pls tell me what is the use of output context in the above formula.

=Max([Sales revenue] ForEach ([Quarter]))

In ([Year])

pls help me in this...

Former Member
0 Kudos

Hi,

The use of output context In ([year]) means that you are displaying your maximum revenue
for each quarters year wise.

Here by using foreach([quarter]) you have added quarter context because
on report you are using only year & state objects

that means if you like to calculate maximum revenue as per quarter wise then by using
foreach([quarter]) you have added input context .

now if you are not giving in([year]) as an output context then
Bo will consider year & state as default output context & that means Bo will get maximum
revenue for each quarter first and then display it as per year & state wise

but as per your requirement you want only year wise maximum revenue so you have mentioned
year in output context.

I hope it will help you in future also.

Thanks,
Swapnil

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Create a variable and choose the qualification type as Measure.

MaxSales=MAX( [SAELSREVENUE] FOREACH [ QUARTER] ) IN ([YEAR]).

Former Member
0 Kudos

Hi ravi,

Thanks for the reply,

I did not create any variable instead RC on the create column ----> double click on that ctrl+Enter

there i have written the above said formula.

Is that formula space sensitive ?

Former Member
0 Kudos

Hi,

I think so, try creating a variable and add it to the block.

Let us know the result.

Former Member
0 Kudos

Hi ravi,

But some times it will work correctly even though i right click---> create column , i don't think that might be the issue...

Need one more info :

MaxSales=MAX( [SAELSREVENUE] FOREACH [ QUARTER] )

 IN ([YEAR]).

what is the main use of IN ( [ YEAR ] ) ( output context ) . is it mandatory to get the output.

can u pls explain  a little bit about the output context that we give to get the output.

Former Member
0 Kudos

Hi,

Here Output context is the year.

Input Context is Year quarter and calculation are max sales revenue.

Output context determines how the values are combined, it is generated by the cell location within the report

Former Member
0 Kudos

Hi ravi,

Thanks for the reply,

Can you pls elaborate in detail as I am very new to WEBI.

saurabh_sonawane
Active Contributor
0 Kudos

=MAX( [REVENUE] FOREACH( [ QUARTER]) ) IN ([YEAR])

Former Member
0 Kudos

Hi saurabh,

I have used the same formula.

Still displaying the formula text only ....

saurabh_sonawane
Active Contributor
0 Kudos

Hi

just do this steps

1. create a new variable measure as maxsales

Note make sure that it contain "=" sign in starting

2 use that filed in that column where you writing a formula

saurabh_sonawane
Active Contributor
0 Kudos

just copy and past this formula in that variable

=MAX( [REVENUE] FOREACH [ QUARTER] ) IN ([YEAR]


paste the complete formula with equal to sign in the formula bar

tanveer1
Active Contributor
0 Kudos

Hi,

You have missed "=".

your formula should be =MAX( [REVENUE] FOREACH [ QUARTER] ) IN ([YEAR]).

Thanks,

Tanveer.

Former Member
0 Kudos

hi tanveen,

i have given = also, still it's not working..

tanveer1
Active Contributor
0 Kudos

Can you share screen shot along with the formula ?