Formula in query result rows
Hello All,
I have a CKF or formala (I tried both) in a query.
There are column 1 and column 2 and column 3 is multiplication of column 1 and column 2.
there are multiple rows and and i see correct value of column 3 for each row.
however in the result row, i want to display column 3 as sum of all rows in column 3.
But it is calculating by multiplying result of column 1 and result of column 2.
Please help.
Thanks
Raj
Edited by: Rajiv Gupta on Apr 16, 2009 1:52 AM
Hello rajiv,
you have a problem like
a | b | a*b
3 | 2 | 6
4 | 5 | 20
7 | 7 | 26 (and not 49)
to achieve this you can use cell references ..
what you need to do is
1. in your query designed click on 'cells' in you 'view toolbar' .... then you can go to cells and modify it
you can find information about it at following link
http://help.sap.com/erp2005_ehp_04/helpdata/EN/5b/30d43b0527a17be10000000a114084/frameset.htm
once you go to 'cells' tab ...right click on desired cell and create cell reference
and put your formula as addition of all the values in column 3
hope this helps
regards,
Swati.
Similar Messages
-
Hi all,
The single cell of key figure in my query is calculated with a formula. I need to calculate every result of this key figure with another formula.
How can I use a different formula for result respect the formula of single cell in the column?
Thanks a lot
GianmarcoHello rajiv,
you have a problem like
a | b | a*b
3 | 2 | 6
4 | 5 | 20
7 | 7 | 26 (and not 49)
to achieve this you can use cell references ..
what you need to do is
1. in your query designed click on 'cells' in you 'view toolbar' .... then you can go to cells and modify it
you can find information about it at following link
http://help.sap.com/erp2005_ehp_04/helpdata/EN/5b/30d43b0527a17be10000000a114084/frameset.htm
once you go to 'cells' tab ...right click on desired cell and create cell reference
and put your formula as addition of all the values in column 3
hope this helps
regards,
Swati. -
Two query result rows in single report according to condition
Is it possible to have a report where the first rwo of the report will display the result of query1 and second row will display the result of query2.
The query1 and Query2 are as follows:
SELECT BNO, DATA1 FROM TABLE1 ;
SELECT RNO, DATA2 FROM TABLE2
The matching condition is BNO = RNO(+)
Kindly suggest ?
Sanjay
CREATE TABLE TABLE1
BNO NUMBER,
DATA1 VARCHAR2(20)
CREATE TABLE TABLE2
RPNO NUMBER,
RNO NUMBER,
DATA2 VARCHAR2(20)
INSERT INTO TABLE1(BNO, DATA1) VALUES(111,'200');
INSERT INTO TABLE1(BNO, DATA1) VALUES(112,'400');
INSERT INTO TABLE1(BNO, DATA1) VALUES(113,'500');
INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(10,111,'100');
INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(11,111,'100');
INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(12,111,'100');
INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(13,112,'400');
INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(14,113,'500');One option can be UNION ALL
SELECT
BNO,
DATA1
FROM
SELECT
BNO, DATA1,rownum as rn
FROM
TABLE1
UNION ALL
SELECT
t2.RNO as BNO, t2.DATA2 as DATA1, rownum as rn
FROM
TABLE2 t2
WHERE
EXISTS
SELECT
1
FROM
table1 t1
WHERE
t1.bno = t2.RNO
ORDER BY
1,3
BNO DATA1
111 200
111 100
111 100
111 100
112 400
112 400
113 500
113 500
8 rows selected -
Position of Result Row in Query
Hi Experts,
I am using Hierarchy in Infoobject, as a result, the query result rows stay in front of characteristic after report was generated:
refer to this picture:
[url]http://imageshack.us/photo/my-images/155/resultrow.png/[url]
is there anyway to move the result row to behind like wat normal queries does?
Thanks.Hi,
Please check the links:-
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c047853e-15bf-2d10-808a-b81acc227a83
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/00d00c2b-5a42-2e10-6288-b9ad2e863761
Hope it helps.
Regards,
Prakash -
Web report - apply specific formula on result rows
dear all,
I would like to apply a specific formula for a result row in a web report.
formula like this (a1b1 + a2b2 + ...)/(a1+a2)
With excel report I know that a vba excel can do this job.
I suppose that with web report a javascript should be helpful to solve this issue.
Is there anybody who could propose me a solution to solve this issue, or a source code example of javascript to do this ?!
Thanks !Hi Guru Prasad,
One possibility is that you are doing some calculation with the user parameter that occurs in the before parameter form trigger.
When running in the normal client-server Reports runtime environment, the report triggers are executed in this order:
1. before parameter form trigger executes
2. parameter form is displayed)
3. after parameter form trigger executes
4. data model is validated and queries prepared)
5. before report trigger executes
6. report is formatted)
7. after report trigger executes
When running on the web, the display of the parameter form and the execution of the report occur in two separate sessions as Reports is "stateless". So, it goes like this when you request the report via a URL:
1. before parameter form trigger executes
2. before parameter form is displayed)
At this point, the user enters in parameters into the web page, and submits the request. As far as Reports is concerned, this is a new report request with parameters fully specified and no parameter form. So, it now does this as a new report request:
1. after parameter form trigger executes
2. data model is validated and queries prepared)
3. before report trigger executes
4. report is formatted)
5. after report trigger executes
So, if you have logic that sets up default values in the before parameter form trigger, it won't get executed on the web. If so, you should move this logic to the after parameter form trigger.
regards,
Stewart -
HOWTO: Writing Out XML Query Results of Any Size in Java with XML SQL Utility
A customer mailed me asking for an example of how to use our XML SQL Utility to write out query results for tons of query result rows.
With tons of data, the getXMLDOM() and getXMLString() methods are not really appropriate due to the size.
The XML SQL Utility offers a getXMLSAX() method that streams SAX2 events to report the data being queried. This is the approach we can use to handle data of any size.
It dawned on me today that by putting together the XML SQL Utilities getXMLSAX() routine, and the oracle.xml.parser.v2.XSLSAXPrintDriver SAX2 ContentHandler, we can effectively stream out data of any length to an appropriate writer.
Here's a code example to get the point across:
package test;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import javax.xml.transform.OutputKeys;
import oracle.jdbc.OracleDriver;
import oracle.xml.parser.v2.XSLException;
import oracle.xml.parser.v2.XSLOutput;
import oracle.xml.parser.v2.XSLSAXPrintDriver;
import oracle.xml.sql.query.OracleXMLQuery;
public class Example {
private static final String QUERY = "select * from emp";
public static void main(String[] args) throws Throwable {
Connection conn = getConnection();
OracleXMLQuery q = new OracleXMLQuery(getConnection(),QUERY);
// Any printwriter will do. Here's we're output to standard out.
PrintWriter output = new PrintWriter(new BufferedOutputStream(System.out));
// This is a SAX2 Content Handler used by the Oracle XSLT Engine
// to serialize a stream of sax2 events as an XML document
// We'll use it to serialize the sax2 events from the XML SQL Utility
// out as an XML document.
XSLSAXPrintDriver ch = new XSLSAXPrintDriver(output, outputOptions());
// This asks XML SQL Utility to fire sax events for the data
// being fetched instead of creating DOM nodes or returning text.
// By using the XSLSAXPrintDriver content handler, these events
// get handled by writing them directly to the output stream
q.getXMLSAX(ch);
ch.flush();
q.close();
conn.close();
private static XSLOutput outputOptions() throws XSLException {
XSLOutput x = new XSLOutput();
Properties props = new Properties();
props.put(OutputKeys.METHOD,"xml");
props.put(OutputKeys.INDENT,"yes"); // Set to "no" for non-indented
x.setProps(props);
return x;
public static Connection getConnection() throws SQLException {
String username = "scott";
String password = "tiger";
String thinConn = "jdbc:oracle:thin:@localhost:1521:ORCL";
Driver d = new OracleDriver();
return DriverManager.getConnection(thinConn,username,password);
}Hi Uber,
This is a known issue that error occurs when running report "Count of instances of specific software registered with Add or Remove Programs" due to non-printable characters for XML. Based on internal research, the hotfix for this issue will be
included in the System Center 2012 Configuration Manager Service Pack 1.
As a workaround, you can remove the nonprintable character populated into the report parameter by referring to the following KB article:
http://support.microsoft.com/KB/914159
Hope this helps.
Regards,
Mike Yin
Mike Yin
TechNet Community Support -
Query Designer - Formulas in Results Row
Hi,
Is it possible to have a formula based purely on values in the results row? e.g.
Col A Col B Col C ColDl
Results Row 4 5 1 40%
Where Col D is Col A as a percentage of the total. I can create a formula for individual rows but not for the results row where it just seems to sum individual percentages.
ThanksHi Gaurav,
i have done what you have suggested:
In query designer > Properties for a Key Figure > Calculations > Calculate Result As > Nothing Defined,
I have set that, despite the rows are calculated as per formula defined in the key figure but the result field is not. The formula is only applied for the rows but not for the result. The result is olthough i have the setting you suggested a summation of that whole column and thats wrong.
Can you or anybody else help.
Thanks and regards,
Murat -
Supress Result rows of a formula in a query
Dear SDN's,
How to supress Result rows of a formula in a query.
For a particular characteristic we can do easily in a query,but how can we restrict result rows for a particular formula?
Thanks and Kind Regards,
Lakshman Kumar GDear Lakshman,
If u supress Result rows for a characteristic,,,then all the key figures for that characteristic,,,,this supression rules applies..
and hence for that particular formula, Supress the relavant characteristic..
It is as simple as that...
Hope this helps u..
Best Regards,
VVenkat..
Edited by: Venkata Narayana Jakkampudi on Jan 5, 2009 5:07 PM -
Formula in Query does not display Results Rows
All -
I know that people have posted this same thread before but I've been unable to find an answer or the questions have not been resolved.
I have created a simple query and the key figure columns are all formulae. The calculations are all the same format: KF1/KF2
Where
KF1 is an Amount kf with Local Currency as the unit (the dataset only contains GBP)
And
KF2 is a counter (the standard 1ROWCOUNT 'number of records' key figure).
The calculations work fine in the rows but I cannot get any results in any Results rows or Overall Result. Something is populated when I do not define anything in "Calculate Results As..." for the formulae, but this is not a summation, and when I select Summation or Total, the Results rows are blank.
I have tried altering settings for the key figures in the admin workbench, I've tried recreating them as global Calculated Key Figures, and I've tried playing around with the settings on the Calculation tab, but nothing works.
Please does someone have an answer to this??
Thanks
MischaHi,
As follows -
Cost (£) # Records Formula
Ref1 500 2 250
Ref2 300 1 300
Ref3 900 3 300
RESULT 1700 6
I have the Cost (£) key figure and the # Records Key figure. These are both hidden.
The formula behind the Formula is simply Cost(£)/#Records.
The characteristic used is not based on the most granular level hence the need for the calculation.
Although the formula is working correctly on a row by row basis, the results rows are blank.
As mentioned above, I have tried changing these to Calculated Key Figures, this has not worked.
Thanks
Mischa -
Query with a condition - Overall results row displays incorrect value
Hi All,
I have a bw query with top 40 conditions. However, The Overall Result Row Figures Do Not Equal The Sum of the Column Rows.
Although the top condition is activated, the overall result still displays the overall result of the whole report.
I have 3 columns in the report
Selected Period
Prior Period and
Variance
The formula for variance is (Selected Period/Prior Period)-1.
Does anyone have an idea to fix this?
Thank you so much in advance.
Have a great day!Hi Gaurav,
Thank you so much for your reply, however this does not solve fully the issue.
Changing the properties to "Summation" will indeed provide me with the correct sum for the "selected period" and "Prior Period." However what I need in the Overall Result Row for the "Variance" column is not the total but instead the value when the total of Selected Period is divided by Prior Period then minus 1.
Overall Variance = (Overall Selected Period/Overall Prior Period)-1
Do you know a way to make this possible.
Thank you so much. -
Getting descrepency in the result row of the Query
Hi All,
I am executing a query which is having 4 Keyfigures and 2 formulas.
I am getting wrong result in the query for formulas.
Below is the query structure
f1 f2 f2%f1 f3 f4 f4%f3
date
1
2
792 408 51.78 9647 8403 88.57
All the keyfigures - result is set as total
Formula - result -nothing is defined(under calculation tab)
The result I am expecting for column 3 is 408/792 = 51.51
The result I am expecting for column 6 is 8403/9647=87.10
To get the expecte result what changes i need to do to the formula.
Thanks
JagadeeshHi Anand,
Thanks for your reply.
If i change it to summation, it will give me sum in the result row.
I am not looking for summation, i want percentage for (overall result F2/overall result F1).
Thanks
Jagadeesh -
Hi
I have sales org, channel, customer and material along with the key figures in the rows
of the query. I am automatically getting result for each level by default and then the
overall result. Is there a way in which i can change all the result rows with
the corresponding text they belong to like the material result, customer result etc.
Thanks
Rashmi.Hi
Not Sure, But try replacement path Variable (with Material Result...etc) and the ckf/Formula(total all the Material, channel...etc) for the same to appear the totals Row .
/people/kamaljeet.kharbanda/blog/2006/12/28/bex-characteristic-variable-with-replacement-path
Hope it helps and clear -
Retrieving BEx Query Results Area for use in Excel formulas
Hello,
I run BEx queries in workbooks and then use Excel formulas ( mostly VLOOKUP(LookupValue, ResultsArea, ColumnReturned,) ) to retrieve certain information from the query ResultsArea.
****Problem:
Depending on the query parameters, the query "Results Area" is larger or smaller.
****Non-optimal solution:
One way to define the ever changing Excel range occupied by the Results Area is to create an Excel name as:
QueryRange = OFFSET(QueryFirstCell,,,COUNTA(OFFSET(Sheet1!$A:$A,,COLUMN(QueryFirstCell)-1,,)),COUNTA(OFFSET(Sheet1!$1:$1,ROW(QueryFirstCell)-1,,,)))
Then, the only input required is the top-left cell of the Results Area, which stays the same (unless the query definition changes).
****Question
What is the best way to refer to an ever-changing query Results Area in an Excel formula?
Thank you!
LouisIt is actually much easier than that.
Use a VBA statement like the following:
Set RptRng = ActiveCell.CurrentRegion
This will retrieve the data in the Results Area, no matter what the size is.
Hope this helps...
Bob -
Result Row in the query output
Hi,
If I restrict a characteristic by hierarchy then I cant have the result row displayed. If the hierarchy active is removed then the result row gets displayed. All characteristics are marked to show the result row.
This characteristic is Account Number. If in the query definition I remove the restriction on account numbers and just select hierarchy active and the required hierarchy in the properties then I get the result row in the output. But now it also displays all the unassigned account numbers in a separate node Not Assigned Account Number (s).
I cant even restrict it in the output with hierarchy active selected. When I do select filter value in the output the options Include in Selection and exclude from Selection are grayed out and hence cant select it.
Please advice on this issue
Thank you,
samHi Jaya,
I think you misunderstood my issue.
My problem is not that i do not want to see the field. But instead, i do not want to see only the results row in the query output.
I need to have the results to populate a calculation via sumct formula.
My question is, can sumct be populated if i hide/supress RESULT row ?
Regards,
Maili -
Result Row of Formula is not using the displayed values
Good Day,
I got a query with following layout
Child Ship Parent Ship Rate
Child Parent ST ST %
Material A F6WH F6WH 55 22 250,00
F7D1 F7D1 55 33 166,67
F8LG F8LG 55 11 500,00
Result 55 66 250,00
The child ship key figure has a setting calculate result as average to display the total shipment of the child. Rate is defined as formula Child Ship %A Parent Ship.
In the result row as Rate I require 83% (55 divided by 66).
It seems that the Rate formular still uses the SUM of child ship 555555 (165 diveded by 66).
Anyone an idea how to get the "wanted result" of 83% ?
Thanks for all replies in advances (points will be assigned).
AxelHi,
As far as i understand the issue is with the child ship keyfigure in that you have selected calcualte result as average which is only for display purpose that result cant be used for futher calculations.
If you want to calculate the average make use of exception aggregation.
Make a new formula and put you keyfigure for which you need to calculate avg. then hit Aggregation tab---Exception aggregation as average and refernce characterstic choose on which you are getting unique set of values.
Then continue with your other steps.
Hope it helps.
Regards,
AL
Edited by: AL1112 on Jun 8, 2011 2:35 PM
Maybe you are looking for
-
Open file in the right folder...
Hello I don't understand why when I run form builder and try to open file, don't open file in start folder. example if I run from command line c:\frmld.exe sometimes when I open file, the open folder is "c:\" but sometimes is "c:\something else" Than
-
Terminal command to refresh USB peripheral device
I'm running OS 10.7.5, and I have a recurring problem with the USB ports on my Mac mini. After several days of up-time, one or more of the ports will sometimes become non-responsive. This seems to be software related, because logging off and loggin
-
Externally edited phots don't transfer
I am trying to use an album to consolidate photos. When I edit a shot in Photoshop.. the edited photo is stored in the stack. when I attempted to transfer the stack to the different album... the edited version does not go.. In the belief that perhaps
-
Iphone 4s update 7.1.1 locked my phone
new update bricked my phone!! How can I retrieve my photos and personal information?
-
Availability Check during Planned Order Conversion to Production Order
Hi PP Gurus, During Conversion it prompts that materials are not available or missing parts log, though in Stock Overview in that Storage Location it contains more quantity(in unrestricted use) that what is needed. Is the requirement date and GR