Average Values in query
Hi
In my query I am unable to average the values in the query is there a way of getting number of records in the query please tell me how to get average values in the query level i went to properties i found the average option but that does not work.
Regards,
Nikhil.
Hi Nikhil,
Try with the solution detailed in the following document:
www.service.sap.com/bi --> Product Information Previous Releases --> Media Library --> HOW TO... Guides --> Guide List SAP BW 2.x --> How to... Count the occurrences of a characteristic.
Ciao.
Riccardo.
Similar Messages
-
To display average value in a graph
Hi There,
In one graph I need to display the duration for each week as per the week range selected and a separate average duration value of the weeks selected.
Is it possible to develop a query for above average value and use this query in WAD?
Can anybody help in providing a solution
Thank you
AnimaBI Query data can be fed directly to WAD Charts.
See below.
http://help.sap.com/saphelp_nw04/helpdata/en/0c/95c83956852b51e10000000a114084/content.htm -
Creating function to calculate average value
Hi,
The below query was successfully return an average value. It returned 1 row.
SELECT AVG(Volume)
FROM security
WHERE
Type = 'Future' AND
Rating = 'AAA' AND
Code = 1 AND
(Day = ''14-mar-09' OR
Day = '16-mar-09' OR
Day = '');
I tried to use that function on my created function below.
CREATE OR REPLACE FUNCTION fn_Vol_Average
( v_DayLast_1_Week IN DATE,
v_DayLast_2_Week IN DATE,
v_DayLast_3_Week IN DATE )
RETURN NUMBER IS
v_Vol_Average NUMBER;
BEGIN
SELECT AVG(Volume) INTO v_Vol_Average
FROM security
WHERE
Type = 'Future' AND
Rating = 'AAA' AND
Code = 1 AND
(Day = v_DayLast_1_Week OR
Day = v_DayLast_2_Week OR
Day = v_DayLast_3_Week);
RETURN NVL(v_Vol_Average, NULL);
END;
I called that function by the following query. it was work, however it return the whole rows. It looks like the function perform the average calculation of each rows on the table.
Can anyone help me what is going on with the logic?
select fn_Vol_average('14-mar-09','16-mar-09','')
from security
--But since your function calculates the average over the whole security table, you wouldn't call this from a select statement which also reads the security table.
You just want to execute it once.
declare
l_vol_average number;
begin
l_vol_average := fn_Vol_average('14-mar-09','16-mar-09','');
dbms_output.put_line(l_vol_average);
end;By the way, be careful with your date parameters. You should use TO_DATE with a proper format mask to prevent conversion errors. -
Hi all
I have a problem with an exception which is defined in BEx Analyser.
The key figure is a valeue in percentage an defined as "Average of all Values <> 0". I have defined to show values >50% in green, but in the query some values (not all) which are >50% (e.g. 83%) are not marked in green, and some values are marked correct.
In other queries, where the same key figure is used but as single values where "calculate result as..." is not defined, the exeption works correct. Just when using the average values it makes the problem.
Any ideas?
Regards
SabineI don't clearly understand the behaviour of BW.Have you tried Formula Collision? If Exception is treated as a formula internally then there may be a collision between Average and Exception.
Formula collision may help Average to take precedence and then it may force the Exception to get it applied.
Sorry Sabine I don't have data to test and I never come across so don't think I am putting u in a loop.
Regs
Gopi. -
How to get formated value from query
i get value from query use the follow method
Object obj1 = dataAccess.getValue(i,j,DataMap.DATA_UNFORMATTED);
Object obj1 = dataAccess.getValue(i,j,DataMap.DATA_FORMATTED);
the first method retrun a value '1666.0',
the second method return a value null
but i want to get the value '1,666'.
who can tell me how can get the formated value?Ahu,
An implementation of DataAccess is not required to support all DataMap constants. For example, the OLAP-based Query object does not support DataMap.DATA_FORMATTED. To find out which DataMaps are supported for a particular implementation, you can call the DataDirector's getSupportedDataMap method.
If you have an Crosstab instance, there is a way to get the formatted cell value, based upon the formatting rules associated with the Crosstab. Get the GridViewFormatManager reference from the Crosstab, and call its formatDataValue method to return a String representation of the formatted data value.
Hope this helps,
djb -
Too many decimals in Average value
Hi
I am using Report Builder and the wizard do design a table which i deploy as a .jsp page.
For some columns in the table I select to display the average values. Some of the values looks fine with one decimal as i want, but some values is displayed with a lot of decimals (about 10) as 164,346666666666666666. I have tried to change the length but without effect. Are there any possibility to decide the number of digits to be shown in the report . Or is i it a bug in Report Builder.Go to Property Inspector of the field and choose the right "Format Mask".
-
Dump when trying to display characteristic values in QUERY DESIGNER
Hi Experts,
Life seems to become a struggle with 7.0 for me :-(.
My current problem:
If I try to display characteristic values in Query Designer (left section of screnn, wthin dimensions) system dumps frequently.
It's that kind of dump, that doen't help really (to my oponion)_
What happened?
The exception 'CX_RSR_X_MESSAGE' was raised, but it was not caught anywhere
along
the call hierarchy.
Since exceptions represent error situations and this error was not
adequately responded to, the running ABAP program
'CL_RSBOLAP_BICS_SERVICES======CP' has to be
terminated.
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"UNCAUGHT_EXCEPTION" "CX_RSR_X_MESSAGE"
"CL_RSBOLAP_BICS_SERVICES======CP" or "CL_RSBOLAP_BICS_SERVICES======CM003"
"HANDLE_UNCAUGHT_EXCEPTION"
... etc.
BW 79, SP21
GUI 7100.4.14.3136
Any ideas?
Thanks in Advance and Regards
JoeHi Vikram,
Thanks for reply. Reinstalling GUI was successful, but - error still occurs. ..
Regards
Joe
Edited by: J.F.B. on May 28, 2010 3:02 PM -
I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
parameter to report parameter i need to pass distinct values. How can i resolve thisHi nancharaiah,
If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
None
Specify values
Get values from a query
If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
sample is for your reference:
Select distinct field_name from table_name
If you have any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Display of "Average Values Text in ALV grid"
Hi
I use ALV grid to display the fields from a table. I have 15 columns. I need to do average for four columns.
In the field catalog i did a do_sum for those fields.
When the ALV grid is displayed I get average values for these columns.
Eg. Let suppose the grid looks like
Field1 Field2 Field3 Field4 Field5 Field 6.
vendor1 18 22 6 17 28
vendor1 54 11 16 62 28
vendor1 33 21 26 79 18
35 18 16 52 24
My requirement is I need to display the text "AVERAGE VALUES" . ( I need something like this.)
Field1 Field2 Field3 Field4 Field5 Field 6.
vendor1 18 22 6 17 28
vendor1 54 11 16 62 28
vendor1 33 21 26 79 18
Average values 35 18 16 52 24
Could someone help me in this?
Thanks & Regards
KavithaHello,
you can use event subtotal_text of ALV_GRID.
Regards,
Pedro Santos -
Calculate Average value based on Day ??
Hello,
I am trying to calculate the Average value based on a day. The data is presented as follows...
Day SOCount
Mon 34
Mon 56
Mon 67
Tues 24
Tues 25
Tues 23
Weds 45
Weds 69
The issue im having is that the Day column needs to be grouped first and the SOCount sumed together. Then the Average SO Count needs to be calculate based on this.
ThanksThanks for the reply,
The solution you have provided only gives me the average of the count of the SO Count, not the actual average of all the values added together then divided by the count..
The report i am creating only has charts in it. So i am trying to create a chart showing the
Average Sale Order Value by day.
I should have metioned this from the start, sorry.
Is it possible to do ?
Edited by: davitali on Nov 4, 2011 6:32 AM -
Script logic to calculate average value on nodes - SAP BPC NW 10.0
Hi experts,
I need to have in the parent members of the dimension TIME (2014.Q1, 2014.Q2, 2014.Q3, 2014.Q4, 2014.TOTAL) the average value of their children and not the sum. For example :
2014.01 2014.02 2014.03 2014.Q1
1 2 3 2
2 = AVG(1, 2, 3)
I tried the script bellow but it doesn't work , it throws the error " ReferenceError : AVG is not defined"
*SELECT(%TIMESET%,"[ID]",TIME,"[CALC]='Y'")
*XDIM_MEMBERSET TIME = %TIMESET%
*XDIM_MEMBERSET MEASURES = PERIODIC
*WHEN DIM1
*IS C02
*WHEN TIME
*IS %TIMESET%
*REC(EXPRESSION = AVG(Descendants([%TIMESET%].CURRENTMEMBER)), TIME = %TIMESET%)
*ENDWHEN
*ENDWHEN
*COMMIT
How can I achieve this ?
Thanks
MahaThe best way is to enter 2 accounts: Productivity and Area, calculating by dimension member formula:
ProductivityPerHectare=IIF([Area]=0,NULL,[Productivity]/[Area])
If you have to enter ProductivityPerHectare and Area, then in script you can calculate Productivity:
*WHEN ACCOUNT
*IS Area
*REC(EXPRESSION=%VALUE%*[ACCOUNT].[ProductivityPerHectare],ACCOUNT=Productivity)
*ENDWHEN
*WHEN ACCOUNT
*IS ProductivityPerHectare //user input
*REC(EXPRESSION=%VALUE%*[ACCOUNT].[Area],ACCOUNT=Productivity)
*ENDWHEN
Then dimension member formula:
ProductivityPerHectareCalc=IIF([Area]=0,NULL,[Productivity]/[Area])
You can use arithmetic average of ProductivityPerHectare only if Area is always constant.
In this case you can create some dummy account member DUMMY and fill it with 1:
*WHEN ACCOUNT
*IS ProductivityPerHectare //user input
*REC(EXPRESSION=1,ACCOUNT=DUMMY)
*ENDWHEN
Then dimension member formula:
ProductivityPerHectareCalc=IIF([DUMMY]=0,NULL,[ProductivityPerHectare]/[DUMMY])
Vadim -
How to calculate average value?
Hi all,
I'm using Lumira 1.15. I'm doing some practices with the sample dataset BestRunCorp... I want to calculate the average value of gross margin which is grouped by lines so that I can use a line chart to show the difference between the gross margin value and average value.
How can I achieve this ?
Best regards,
ShuangIt looks like it calculates the average based on the dimension
See below:
If you take the "Best run" Excel file, sort by country, calculate the average in Excel, it matches Lumira's 4,056 (for Argentina)
I am not sure I follow your divide by 12 logic? -
the data I measured changed rapidly, so i want get the average value of the data
Do not tell me to use mean.vi , i have already know that.
and i got an idea which is add the data into an array every time, then sum of all the data value and take the result divide by the number of elements
but i dont know how to achieve that, anyone can build a simple vi to show me ? thank you
i have attached my vi which is using mean.vi to calc the average value, you can delete it and using in your way , thank you !
Solved!
Go to Solution.
Attachments:
EN-new.vi 274 KBHi I got a similar issue for averaging. I used the mean.vi from the math function but the average is rolling when i run it. I am trying to calculate the average for the data i read to the RT FIFO (which is around 40000 lines).I got the writing part working, however, when i am reading the data, I couldn't get it working. I thought i read the data as a 1-D array, and then pass it to the Mean.vi and then got the result. But seems like the mean is only showing the last data in the array.
Can someone help me with this??
Attachments:
FPGA-vi.png 242 KB
RT-vi.png 182 KB
RT-2mod.vi 515 KB -
Read-in CSV and Calculate Average Value
I've got a csv file which I'm reading in but need to calculate the average value of the second column (CPU). It's in the following format:
Date CPU
01/09/2014 25.3
02/09/2014 22.3
03/09/2014 26.2
04/09/2014 22.1
I basically need the average CPU for the month. Any advice?
Thanks in advance
Adam"Date","CPU"
"01/09/2014","25.3"
"02/09/2014","22.3"
"03/09/2014","26.2"
"04/09/2014","22.1"
'@ | sc test.csv
(Import-Csv test.csv | measure CPU -Average).Average
23.975
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
Hello
How to make labview program to get average value of 200 reading from multimeter (I using using loop) to read voltage from mulmeter but I like to get average value of all of 200 reding how can I do that?
Thanks
Wee
Solved!
Go to Solution.Another idea with less programming - take advantage of the "free" array that comes with a Chart - i.e. the History Data.
1) Wire your DMM data to a Chart. (You can set the chart to invisible if you don't plan on using it in the GUI).
2) Set the Chart History Length to 200 (right click on the chart, click on Chart History Length...)
3) On the block diagram, use the History Data Property Node, wire it to Mean.vi, and you're done.
Easiest running average ever.
Message Edited by Broken Arrow on 04-07-2010 11:36 AM
Richard
Attachments:
EasyAvg.jpg 8 KB
Maybe you are looking for
-
The email which I used for my icloud id has stopped all its services. I cannot gain access to this email anymore. I am able to change my Apple ID but unable to change iCloud ID. My ipad 2 keeps popping up asking for the icloud password. Can anyone
-
Unable to make Postal code as required field in Vendor master creation
Hi, We have a requirement of making Postal code (POST_CODE1) field under street address of new vendor master creation/change as a required field. In the configuration settings of vendor account group (OBD3), SAP provided Postal code City combined as
-
How to delete a template in Keynote '09
I saved a file as a Keynote template, but now want to delete it. Where are these stored on my hard drive?
-
Hi, I want to find for a particular field in which T-code it is appearing? Eg: Let say Lot size field is appearing in T-code: MM01. Is it possible to find in that way?. Regards/US
-
Storage location extension for Blocked and Quality inspection stocks
Hi All, Could any one explain how to extend a Storage location (which is actually maintained for the Returns) to make use for the Blocked and Quality inspection stocks. Does this require any config settings. Thanks in advance. Kalyan