cancel
Showing results for 
Search instead for 
Did you mean: 

Math Calculation in Bex query

Former Member
0 Kudos

Dear Experts,

I have the below data in BW.

Date Time(Hr)

CO2

(zk_value)

H2O

(zk_value)

20/2/201410.6659396.141796
20/2/201420.5845073.286
20/2/201430.6021693.636601
20/2/201440.6666843.030161
20/2/201450.6949913.515662
20/2/201460.7155073.424114
20/2/201470.7400893.739442
20/2/201480.6467522.978481
20/2/201490.5497142.152406
20/2/2014100.498012.804975
20/2/2014110.4310978.513797
20/2/2014120.41158850.08882
20/2/2014130.237801110.5091
20/2/2014140.21837896.62129
20/2/2014150.24238146.51961
20/2/2014160.24030419.21492
20/2/2014170.3262984.918987
20/2/2014180.3899334.256416
20/2/2014190.4041483.939687
20/2/2014200.4103643.430606
20/2/2014210.4166533.10039
20/2/2014220.448333.06806
20/2/2014230.4813012.99557
20/2/2014240.55795912.70483

Now i need to represent the data in BI report as below.

Prarmeter          Max(in a day)     Min(in a day)   Daily Avg

CO_mgm          0.74                    0.21               0.48

H2O                  110.5                  2.15             16.85

Used Parameter and Date  as Characteristic info object (rows)

created 3 formulas in columns. In general tab of formula i selected (zk_value * 1) and in aggregation tab i  selected as max , min, avg in exception aggregation and used date as ref characteristic for all the 3 formula respectively but im not getting correct values. Im simply getting summation as the result.

Please guide me to achieve the result.

Thankyou

Vijay

Accepted Solutions (1)

Accepted Solutions (1)

ccc_ccc
Active Contributor
0 Kudos

Hi Vijay,

1 Create two structures.

2 In Rows, right click on newly created structure->select new selection

3 Create two selections CO2 and H2O

4 Click on cell restrict first selection with CO2 and second H2O

5 Do same what you did earlier 3 formulas select min for both calculated single and result value

check and let me know.

Thank you,

Nanda

Former Member
0 Kudos

Hi Nanda,

Thanks for your reply. Like CO2, H2O i have many values SO,H2S,PM etc.. these are values of ZC_PARA Infoobject. So i dont think i can use structure. could you pls give me other solution.

Regards

Vijay

former_member566306
Participant
0 Kudos

Hi Vasu,

Can you try doing this below.

In the calculations tab of formulas for max value use " Calculate result as Maximum" similarly for minimum value use " Calculate result as Minimum" .For average use "Calculate result as average"

I guess this will help.

Thanks,

Dharma

Former Member
0 Kudos

Thanks Dharma, Now Am getting the desired result. But still avg is not calculating. pleas refer below screen shot as example

For the daily avg column, result row showing correct value 37 as expected but individual records not showing.

Thanks

Vijay

Former Member
0 Kudos

Hi vijay

you can use SUMGT data function in order to get on individual records on Daily Average.

Hope this helps.

Thank you

sunil

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Create a couple of Calculated KF.

For each one add the original KF and add an "Aggregation" using MIN, MAX and AVG with a "Reference Characteristic" your DATE infoObject.

Add over your KF structure the ZC_PARA and the calculation will be broken for each value.

When you display the detail by DATE, each day shows your calculations.

Regards!

RG