Query Parameters Problem
Please excuse the formatting as I am not sure why the forum is bunching everything together and not putting my query in code format.
Hi All,
We are using SAP B1 2007 A SP01 PL05
I am having a problem with getting a query to run in SAP with parameter selections. The query below runs fine as is however once I add date parameters which look like this
AND T2.[DocDate] >= '[%0]' AND T2.[DocDate] <= '[%1]'
I start getting errors. The first error I got was RIGHT.CardCode could not be bound once I removed the parameter and added them again I got an error Conversion failed when converting datetime from character string. I then removed the parameters again and added them once more and got another error An expression of non-boolean type specified in a context where a condition is expected. I saved the query and logged out and logged back in and ran it again and now am getting the error RIGHT.CardCode could not be bound again.
Could someone please have a look at this and try and help me get this running as I want to add more parameters where you can select the Customer Group and the Item Group as well.
SELECT T2.DocDate, T2.DocNum, T2.CardCode, T2.CardName, T5.GroupName, T1.ItemCode, T1.Dscription AS 'Description', T7.ItmsGrpNam, T1.Quantity, T0.Price AS 'Unit Price (List)', T0.Price * T1.Quantity AS 'Gross Total', T1.LineTotal / T1.Quantity AS 'Unit Price (Doc)', T1.LineTotal AS 'Nett Total'
FROM ITM1 AS T0 INNER JOIN
INV1 AS T1 ON T0.ItemCode = T1.ItemCode INNER JOIN
OINV AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
OPLN AS T3 ON T0.PriceList = T3.ListNum INNER JOIN
OCRD AS T4 ON T2.CardCode = T4.CardCode INNER JOIN
OCRG AS T5 ON T4.GroupCode = T5.GroupCode INNER JOIN
OITM AS T6 ON T1.ItemCode = T6.ItemCode INNER JOIN
OITB AS T7 ON T6.ItmsGrpCod = T7.ItmsGrpCod
WHERE T0.PriceList = 1
UNION ALL
SELECT T2.DocDate, T2.DocNum, T2.CardCode, T2.CardName, T5.GroupName, T1.ItemCode, T1.Dscription AS 'Description', T7.ItmsGrpNam, - (1 * T1.Quantity) AS Quantity, - (1 * T0.Price) AS 'Unit Price (List)', - (1 * (T0.Price * T1.Quantity)) AS 'Gross Total', - (1 * (T1.LineTotal / T1.Quantity)) AS 'Unit Price (Doc)', - (1 * T1.LineTotal) AS 'Nett Total'
FROM ITM1 AS T0 INNER JOIN
RIN1 AS T1 ON T0.ItemCode = T1.ItemCode INNER JOIN
ORIN AS T2 ON T1.DocEntry = T2.DocEntry INNER JOIN
OPLN AS T3 ON T0.PriceList = T3.ListNum INNER JOIN
OCRD AS T4 ON T2.CardCode = T4.CardCode INNER JOIN
OCRG AS T5 ON T4.GroupCode = T5.GroupCode INNER JOIN
OITM AS T6 ON T1.ItemCode = T6.ItemCode INNER JOIN
OITB AS T7 ON T6.ItmsGrpCod = T7.ItmsGrpCod
WHERE T0.PriceList = 1
Any help will be greatly appreciated.
Try this one:
Declare @d1 datetime
Declare @d2 datetime
set @d2=/*Select T2.DocNum from oinv T2
where T2.Docdate between [%0] and */[%1]
set @d1=[%0]
SELECT T2.DocDate, T2.DocNum, T2.CardCode, T2.CardName,
T5.GroupName, T1.ItemCode, T1.Dscription AS 'Description',
T7.ItmsGrpNam, T1.Quantity, T0.Price AS 'Unit Price (List)',
T0.Price * T1.Quantity AS 'Gross Total',
T1.LineTotal / T1.Quantity AS 'Unit Price (Doc)', T1.LineTotal AS 'Nett Total'
FROM ITM1 AS T0 INNER JOIN INV1 AS T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN OINV AS T2 ON T1.DocEntry = T2.DocEntry
INNER JOIN OPLN AS T3 ON T0.PriceList = T3.ListNum
INNER JOIN OCRD AS T4 ON T2.CardCode = T4.CardCode
INNER JOIN OCRG AS T5 ON T4.GroupCode = T5.GroupCode
INNER JOIN OITM AS T6 ON T1.ItemCode = T6.ItemCode
INNER JOIN OITB AS T7 ON T6.ItmsGrpCod = T7.ItmsGrpCod
WHERE T0.PriceList = 1
and T2.Docdate between @d1 and @d2
UNION ALL
SELECT T2.DocDate, T2.DocNum, T2.CardCode, T2.CardName,
T5.GroupName, T1.ItemCode, T1.Dscription AS 'Description',
T7.ItmsGrpNam, - (1 * T1.Quantity) AS Quantity,
- (1 * T0.Price) AS 'Unit Price (List)',
- (1 * (T0.Price * T1.Quantity)) AS 'Gross Total',
- (1 * (T1.LineTotal / T1.Quantity)) AS 'Unit Price (Doc)',
- (1 * T1.LineTotal) AS 'Nett Total'
FROM ITM1 AS T0 INNER JOIN RIN1 AS T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN ORIN AS T2 ON T1.DocEntry = T2.DocEntry
INNER JOIN OPLN AS T3 ON T0.PriceList = T3.ListNum
INNER JOIN OCRD AS T4 ON T2.CardCode = T4.CardCode
INNER JOIN OCRG AS T5 ON T4.GroupCode = T5.GroupCode
INNER JOIN OITM AS T6 ON T1.ItemCode = T6.ItemCode
INNER JOIN OITB AS T7 ON T6.ItmsGrpCod = T7.ItmsGrpCod
WHERE T0.PriceList = 1
and T2.Docdate between @d1 and @d2
Sometimes SBO does not manage correctly variables in complicated queries and there is a note about the workaround to solve the problem:[Note730960|https://websmp130.sap-ag.de/sap/bc/bsp/spn/sapnotes/index2.htm?numm=730960]
Similar Messages
-
Number of Query parameters problem
Ok, so I have a form that has always has one of two values filled in, but a different number of parameters in the rest.
Example:
The user will have to fillin (City) and (State), or (zipcode) to do a query. But they can also fill in the (numOfBedrooms), (numOfBathrooms), (minPrice), (maxPrice), etc...
How do I get the information out and query against the right data fields. I thought of putting the collected data into an array for each item that is queried, but I need to know how to construct the Where clause, like.
WHERE numOfBedrooms = " + inputNumBeds + " AND" + etc...
What if they don't put in the number of bedrooms, and put in only the number of bathrooms or the max price?
How do I know when to use the AND, >=, <=, >= and <=, in the right place?
I just dont know how to construct the query and put it all together when its submitted by the form?
Thanks in advance.
orozcomThanks guys, Will do.
So with each one should I do something like.
If (numBedroom != null)
Insert the and statement;
or should I do a
if (numBedroom != 0) // This will be a pulldown menu
anyway. I could just default to 0.
Insert the and statement.
Zero is a magic value in the above so null might be a better choice. Using null requires the use of Integer vs int though. That decision is rather minor. However if you have some cases where zero is a legitimate value to search on then for numerics it might be better to choose a really good magic value like Integer.MIN_VALUE.
>
Same with the price, but I could probably do a.
If(( minPrice != 0) && (maxPrice !=0))
insert the > minPrice and < maxPrice statement
Then do the other if statements.
As suggested you can get creative if you want or need to.
In the above what you have is one field with different operations possible. So you would have...
- operand
- leftValue
- rightValue
Operand can then have values like "equals", "greater than" and "between". For the specific example you gave above the operand would be "between" and you would use both values. -
SQL trace query parameters round 2
Hi,
This is a follow up of this topic:
SQL trace query parameters
My problem is no matter what i do, the queries in my trace file do not show the query paramaters.
I have tried several approach including this:
http://theblasfrompas.blogspot.com/2010/05/dbmsmonitor-for-tracing-from-oracle.html
Any idea why it isn't working? (I'm using Oracle XE 11g)
Thanksuser610868 wrote:
Hi,
This is a follow up of this topic:
SQL trace query parameters
My problem is no matter what i do, the queries in my trace file do not show the query paramaters.
I have tried several approach including this:
http://theblasfrompas.blogspot.com/2010/05/dbmsmonitor-for-tracing-from-oracle.html
Any idea why it isn't working? (I'm using Oracle XE 11g)
Thankshttp://www.lmgtfy.com/?q=oracle+sql_trace+level=4 -
POWL - Query parameters doesn't open
Hi Gurus,
I configured a POWL for shopping carts based on SAPSRM_E_CHECK_STATUS.
1. Create custom application ID
2. Create a custom POWL type with the standard feeder (/SAPSRM/CL_CLL_PWL_A_SC_ESS)
3. Create the link between application ID and POWL type (Tx. POWL_TYPER)
4. Create the query with the POWL Type ID.
At this last one if you click on button "Query parameters" any windows is opened.
Can anybody help me?
I double check the configuration but I didn't see any problem.
Many thanks in advance.
David.Hi Konstantin,
I solved by myself.
I didn't create the field catalog for POWL Type. For this reason I hadn't any field to show into the query parameters.
Thanks,
David. -
How to send query parameters using BIApplicationFrame in WD Java
HI,
I am working on integration of BEx WebTemplate in webdynpro view.
I am using BIApplicationFrame ui element for this.
I set the template id in template property of BIApplicationFrame.
I have to execute a query of this template.
So i selected the option 'query' of dataProviderStateType property.
How to send the query parameters to that query.
I am setting the fowlloing values in BIApplicationFrame
dataProviderStateName: BEx Query Name
dataProviderStateType: query
server: server url
server type: java
templateid: BEx template id.
The query screen is opening ..But no data.
I have to pass the following two parameters to that query:
BI_COMMAND_1-I_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=ZVARCUST01&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=0500000003
&BI_COMMAND_2-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_2-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=0I_CMNTH&BI_COMMAND_2-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING&BI_COMMAND_2-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=01/2000-12/2002
How to send these two query parameters using BIApplicationFrame.
I did not find any help ( Example tutorial ) for BIApplicationFrame UI element in SDN.
Please help me.My problem solved. I used the following code in wdModifyView() method.
Map parameters=new HashMap();
parameters.put("BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=ZVARCUST01&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING","0500000003");
parameters.put("BI_COMMAND_2-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_2-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=0I_CMNTH&BI_COMMAND_2-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING&BI_COMMAND_2-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING","01/2000-12/2002");
WDBIMethods.addCustomParameters(wdThis.wdGetAPI(),"BIApplicationFrame",parameters); -
Managing beans based on URL query parameters
I was just reading this thread with interest, but it didn't come to the conclusion that I need.
http://forum.java.sun.com/thread.jsp?forum=427&thread=441432
In that thread, there were two screens: a table of links to employees and an "edit employee" page. The solution was to use the command_action on the list create an "employee data" bean, which could then be edited on the "edit employee" page.
My problem is that I need to create some session beans based on query parameters in the URL. Using the example above, I'd have something like: http://localhost/app/editEmployee?empNo=38
Why? Because the user can bookmark the edit employee page, have two
browser windows open (which would require two seperate employee data beans), etc... and we need to handle that. It looks like
that means I can't use the solution in the above thread.
My current thought is to create a managed-bean with request scope and have it create the EmployeeData bean.
Another idea is to somehow initialize the bean with managed-properties
<managed-bean>
<managed-bean-name>EmpBean</managed-bean-name>
<managed-bean-class>com.mycompany.EmpBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>employeeID</property-name>
<value-ref>queryParamBean</value-ref>
</managed-property>
</managed-bean>
<!--
just returns FacesContext.getCurrentInstance().getServletRequest().getParameter("id")
-->
<managed-bean>
<managed-bean-name>queryParamBean</managed-bean-name>
<managed-bean-class>com.mycompany.QueryParamBean</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>but that seems kinda hacky. Any other ideas?Excellent, using requestScope gets rid of the queryParamBean hack from my first post. For some reason I thought value-ref evaluatations only resolved against stuff the VariableResolver can see. That's not the case. Thanks.
Unfortunately, this bean really wants to be cached on the session, not the request. I suppose it would be possible to have EmpBean delegate to a bean which is actually cached on the session, but that feels like a hack too (and is a lot of glue code).
So, I think I'm back to the factory, which can handle creating the bean from the query params, caching it, and putting it on the servlet request. I also got a visit from Captain Obvious and realized that the factory could just be a scriplet.
<% BeanCreator.createBean("com.company.EmpBean", request.getParameter("id")); %>which also isn't great, but is perhaps easier to understand than the BeanCreator from above. I looked into using EL Functions in the variable resolver for the factory, but it doesn't look like that's possible. It's probably possible to extend VariableResolver to add factory methods for managed-beans, which might be the cleanest solution. I'm thinking something like
<managed-bean>
<managed-bean-name>Emp</managed-bean-name>
<managed-bean-factory>
<factory-name>com.company.BeanFactory.getBean</factory-name>
<bean-class>com.company.EmpBean</bean-class>
<arg-value-ref>sessionScope.id</arg-value-ref>
</managed-bean-factory>But for now, the current two hacks are:
#1: to create a URL use plain html <href>.
#2: use a factory method (varying implementions) to create the bean, cache it, and put it on the servlet request -
BI Java SDK - query parameters
Hello.
I`m using BI Java SDK to develop a custom Java Swing Application to integrate with the SAP BW 3.5
I need to replicate the BW query in Java Application and execute this in the Java Side.
My question is: ...can i replicate the initial screen of the BW query in Java Application ?
The initial screen of bw query with the filters and parameters to execute the query in Java side.
How i capture the filters and paramenters of BW query in BI Java SDK ?
Best Regards.
TaylorWe have a problem with the API BI Java SDK.
In my application, i using the swing and BI Java SDK to list al cubes and execute the queries.
The tutorials in "BI Java SDK Examples page" are in "Hard Coded" for all itens, parameters, cubes, mdx Queries ...etc !!!
When i try to execute the query i need add all dimensions in rows to set in moveDimensionToRows in IBICommandProcessor Class
This the sample code and the problem:
//Create olap Query and Commandprocessor
IBIQuery query = olap.createQuery(cube);
IBICommandProcessor commandProcessor = query.getCommandProcessor();
//Here i set the dimension in "hard Coded", but my application captures this automatically to set the dimensions.
Dimension dimension1 = olap.getObjectFinder().findDimensionFirst(cube, "0CALMONTH");
Dimension dimension2 = olap.getObjectFinder().findDimensionFirst(cube, "EPINSTALA__0UCRATE_CAT");
// Here i move the (dimension1 and dimension2 to rows. <-- THE PROBLEM IS HERE - How to capture only dimensions in rows to set in moveDimensionRows ???
commandProcessor.moveDimensionToRows(dimension2);
commandProcessor.moveDimensionToRows(dimension1);
// Execute the query and retrieve the result set.
IBIDataSet dataset = query.execute();
Problem --> When i try to execute the query without set moveDimensionToRows, this return only the global result of query (1 row only).
To return all data in my Grid (JTable), i need to set moveDimensionToRows.
How i can capture only the rows dimensions to set in moveDimensionToRows and collum dimension ???
How to separate row dimension and collum dimension???
thanks... -
How to handle a large number of query parameters for a Browse screen
I need to implement an advanced search functionality in a browse screen for a large table. The table has 80+ columns and therefore will have a large number of possible query parameters. The screen will be built on a modeled query with all
of the parameters marked as optional. Given the large number of parameters, I am thinking that it would be better to use a separate screen to receive the parameter input from the user, rather than a Popup. Is it possible for example to have a search
button on the browse screen (screen a) open a new screen (screen b) that contains all of the search parameters, have the user enter the parameters they want, then click a button to send all of the parameters back to screen a where the query is executed and
the search results are returned to the table control? This would effectively make screen b an advanced modal window for screen a. In addition, if the user were to execute the query, then want to change a parameter, they would need to be able to
re-open screen b and have all of their original parameters still set. How would you implement this, or otherwise deal with a large number of optional query parameters in the html client? My initial thinking is to store all of the parameters in
an object and use beforeShown/afterClosed to pass them between the screens, but I'm not quite sure how to make that work. TIAWow Josh, thanks. I have a lot of reading to do. What I ultimately plan to do with this (my other posts relate to this too), is have a separate screen for advanced filtering that also allows the user to save their queries if desired.
There is an excellent way to get at all of the query information in the Query_Executed() method. I just put an extra Boolean parameter in the query called "SaveQuery" and when true, the Query_Executed event triggers an entry into a table with
the query name, user name, and parameter value pairs that the user entered. Upon revisiting the screen, I want the user to be able to select from their saved queries and load all the screen parameters (screen properties) from their selected query.
I almost have it working. It may be as easy as marking all of the screen properties that are query parameters as screen parameters (not required), then passing them in from the saved query data (filtered by username, queryname, and selected
item). I'll post an update once I get it. Probably will have some more questions as I go through it. Thanks again! -
Using Form to pass value to query parameters in the selct part of query
I created a form in Access 2007 to pass 2 values to an Access query. I am doing this to create delimited output (very large) with the parameters included in the selected data. The select works and is something like this:
SELECT "^"+!FORM!EXPORT2DAT!PREF_VALUE+"_"+Replace(UCase([column_1])," ","_")+"^|" AS OUTPUT_column1, "^"+!FORM!EXPORT2DAT!COMPANY_VALUE+[COLUMN_3]+"
([COMPANY_VALUE])"+"^|" AS OUTPUT_column2,....................
The form has text boxes for the values I want to pass PREF_VALUE and COMPANY_VALUE to the query parameters, and an execute button to open the query when clicked.
However when I enter the values and click the execute button, I still get the parameter boxes for the 2 parameters. 1 for this: !FORM!EXPORT2DAT!PREF_VALUE, and FORM!EXPORT2DAT!COMPANY_VALUE. I thought I was filling in with the form text box values.
Can I use the form's text boxes to pass values to concatenated using(+) columns in the select part of the query as I'm doing above?
Thanks in advance for your response.I have never seen a select statement like that!
For query criteria I would use this --
[FORMS]![EXPORT2DAT]![PREF_VALUE]
and [FORMS]![EXPORT2DAT]![COMPANY_VALUE]
Build a little, test a little -
"Source not found" Error creating URL Data control with query parameters
Hi,
I have a restful service for which i want to create a URL data control. I am able to create the URL data control successfully when i am not passing any parameters in the Source field. But if i am specifying the parameters in the source field like this Department=##ParamName##, something weird is happening. After giving the param string in the Source field, it asks for default param value to test the url. It tests the url successfully. After that i select XML as the data format in which i am mentioning the xsd like this . "file:///C:/..../something.xsd" . And this is when i am getting the error. "Invalid Connection. The source is not found". I am giving exactly same path for xsd which i gave while creating URL data control without query parameters. Infact i was able to create the URL data control with query parameters successfully till afternoon. after that it started giving me this error all of a sudden. Infact as soon as i was able to create a URL data contol with query parameter successfully, i took a backup of the application before moving further. But even that backup is not working now.
As far as i understand, i dont think there will be any change in xsd if query params are passed to a web service. Please correct me if i am wrong.
Just dont know what could be the issue. Please help
ThanksHi,
xsd is used for the URL service to know what the returned data structure is so it can create the ADF DC metadata
Frank -
hi ,
we are generate query in 2005b,and procced for execuite query.following problem occure'<b>odbc sql server driver'[sql server] syntax error the converting the nvarchar value' 70302/20307' to column of data type int received alert OAIB</b>
QUERY SHOWN BE AS FOLLOW.
SELECT T5.DocNum as'Po. No. ', T5.DocDate as 'Po Date',T0.CreateDate,T5.NumAtCard as 'Man.PO. No/ Dt.', T0.DocNum as'AP No. ', T0.DocDate as 'AP Date',T0.NumAtCard as 'Vendor Ref. No.', T0.U_vbdt as 'Vendor Ref. Date', T0.CardName as 'Vendor', T1.Dscription as 'Item', T1.Quantity AS 'QTY' , T1.Price as 'Basic Rate', (T1.Price *T1.Quantity) as 'Value',T0.Comments as 'Po No. & Po.Dt.' FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN OPDN T3 ON T2.CardCode = T3.CardCode INNER JOIN PDN1 T4 ON T3.DocEntry = T4.DocEntry INNER JOIN OPOR T5 ON T2.CardCode = T5.CardCode INNER JOIN POR1 T6 ON T5.DocEntry = T6.DocEntry INNER JOIN OITM T7 ON T1.ItemCode = T7.ItemCode INNER JOIN OITB T8 ON T7.ItmsGrpCod = T8.ItmsGrpCod WHERE ( T1.BaseRef = T3.DocNum ) AND ( T4.BaseRef = T5.DocNum ) AND ( T0.U_vbdt >=[%25]AND T0.U_vbdt <=[%26]) AND ( T4.Dscription =T1.Dscription ) AND ( T4.Dscription = T6.Dscription ) AND (( T1.Dscription=[%0] OR T1.Dscription=[%1] OR T1.Dscription=[%2] OR T1.Dscription=[%3] OR T1.Dscription=[%4] OR T1.Dscription=[%5] OR T1.Dscription=[%6] OR T1.Dscription=[%7] OR T1.Dscription=[%8] ) OR ( T0.CardName=[%10] OR T0.CardName=[%09] OR T0.CardName=[%27] OR T0.CardName=[%28] ) OR (( T8.ItmsGrpNam =[%11] oR T8.ItmsGrpNam =[%12] OR T8.ItmsGrpNam =[%13] OR T8.ItmsGrpNam =[%14] OR T8.ItmsGrpNam =[%15] OR T8.ItmsGrpNam =[%16] OR T8.ItmsGrpNam =[%17] OR T8.ItmsGrpNam =[%18] OR T8.ItmsGrpNam =[%19] ) and ( T7.U_FirmName =[%20] OR T7.U_FirmName =[%21] OR T7.U_FirmName =[%22]
oR T7.U_FirmName =[%23] OR T7.U_FirmName =[%24] )) )Hi Vishal,
the value '70302/20307' is not an whole number so converting it to an int is not possible.
You should check your data for this value an change your query or data.
Regards
Ad -
Query designing problem while applying cell properties
Hello Experts,
I have a problem while designing query. Problem is as follow:
I have a calculated field on key figure column. This key figure calculates variance between 2 columns.
for E.g I have 2 columns Budget and Actual and third column is %Variance which should be
1. ((Actual - Budget)/Budget) *100 or
2. ((Budget -Actual)/Budget)*100, depening on some values on the row i should use any of these 2 formulas but the result should be dispalyed in single column % Variance.
how can i change the formula in key figures depending on these conditions. I can achieve this by applying cells but i dont want to do so as it is very complex way to desing these queries.
also let me know applying cells on query affects its performance or not?
Regards,
NiravHi Nitin,
Your reply may help me.
But my exact requirement is not that. Requirement is as follow:
I have created Char. Structure in row which contains few rows as revenue and few rows as expense.
I created them by creating selections. Now in case of expense the variance should be (Budget-Actual)/Budget *100.
In case of revenue variance should be (Actual-Budget)/Budget *100.
So, here i have to find out revenue & expense char. iresspective of which one is greater.
Regards,
Nirav -
Below query has problem .
Pls see the queries for Usage Summary with Partition and Without Partition
. I have executed this now so it may be in Buffer …****
DB Query ... SUM from event objects, bin variables
SELECT sum(amount) , sum(quantity), event.poid_type,ebal.resource_id,****
event.service_obj_type, event.service_obj_id0,ebal.
rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
FROM event_bal_impacts_t ebal, item_t item, event_tevent*
WHERE event.item_obj_id0 = item.poid_id0****
AND ebal.obj_id0 = event.poid_id0****
-- and event.Poid_id0 >= 266838277921701888****
-- and event.Poid_id0 < 267928993456455680****
-- and ebal.obj_id0 >= 266838277921701888****
-- and ebal.obj_id0 < 267928993456455680****
AND item.bill_obj_id0 = 148715294****
AND ebal.product_obj_id0 = 27433706****
AND ebal.account_obj_id0 = 146876519****
AND item.account_obj_id0 = 146876519****
AND event.poid_type like '%session/telco/gsm%'****
AND ebal.impact_category <> 'Free'****
AND resource_id not in (select resource_id from
resource_id_t)****
group by****
event.poid_type, ebal.resource_id,****
event.service_obj_type, event.service_obj_id0,****
ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
IMPACT_CATEGORY****
order by****
ebal.resource_id desc;****
SELECT sum(amount) , sum(quantity), event.poid_type,ebal.
resource_id,****
event.service_obj_type, event.service_obj_id0,ebal.
rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
FROM event_bal_impacts_t ebal, item_t item, event_tevent*
WHERE event.item_obj_id0 = item.poid_id0****
AND ebal.obj_id0 = event.poid_id0****
and event.Poid_id0 >= 264199450015039488****
and event.Poid_id0 < 265237388991660032****
and ebal.obj_id0 >= 264199450015039488****
and ebal.obj_id0 < 265237388991660032****
AND item.bill_obj_id0 = 148715294****
AND ebal.product_obj_id0 = 27433706****
AND ebal.account_obj_id0 = 146876519****
AND item.account_obj_id0 = 146876519****
AND event.poid_type like '%session/telco/gsm%'****
AND ebal.impact_category <> 'Free'****
AND resource_id not in (select resource_id from
resource_id_t)****
group by****
event.poid_type, ebal.resource_id,****
event.service_obj_type, event.service_obj_id0,****
ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
IMPACT_CATEGORY****
order by****
ebal.resource_id desc;****
--848478 wrote:
Below query has problem .
Pls see the queries for Usage Summary with Partition and Without Partition
. I have executed this now so it may be in Buffer …****
DB Query ... SUM from event objects, bin variables
SELECT sum(amount) , sum(quantity), event.poid_type,ebal.resource_id,****
event.service_obj_type, event.service_obj_id0,ebal.
rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
FROM event_bal_impacts_t ebal, item_t item, event_tevent*
WHERE event.item_obj_id0 = item.poid_id0****
AND ebal.obj_id0 = event.poid_id0****
-- and event.Poid_id0 >= 266838277921701888****
-- and event.Poid_id0 < 267928993456455680****
-- and ebal.obj_id0 >= 266838277921701888****
-- and ebal.obj_id0 < 267928993456455680****
AND item.bill_obj_id0 = 148715294****
AND ebal.product_obj_id0 = 27433706****
AND ebal.account_obj_id0 = 146876519****
AND item.account_obj_id0 = 146876519****
AND event.poid_type like '%session/telco/gsm%'****
AND ebal.impact_category <> 'Free'****
AND resource_id not in (select resource_id from
resource_id_t)****
group by****
event.poid_type, ebal.resource_id,****
event.service_obj_type, event.service_obj_id0,****
ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
IMPACT_CATEGORY****
order by****
ebal.resource_id desc;****
SELECT sum(amount) , sum(quantity), event.poid_type,ebal.
resource_id,****
event.service_obj_type, event.service_obj_id0,ebal.
rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
FROM event_bal_impacts_t ebal, item_t item, event_tevent*
WHERE event.item_obj_id0 = item.poid_id0****
AND ebal.obj_id0 = event.poid_id0****
and event.Poid_id0 >= 264199450015039488****
and event.Poid_id0 < 265237388991660032****
and ebal.obj_id0 >= 264199450015039488****
and ebal.obj_id0 < 265237388991660032****
AND item.bill_obj_id0 = 148715294****
AND ebal.product_obj_id0 = 27433706****
AND ebal.account_obj_id0 = 146876519****
AND item.account_obj_id0 = 146876519****
AND event.poid_type like '%session/telco/gsm%'****
AND ebal.impact_category <> 'Free'****
AND resource_id not in (select resource_id from
resource_id_t)****
group by****
event.poid_type, ebal.resource_id,****
event.service_obj_type, event.service_obj_id0,****
ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
IMPACT_CATEGORY****
order by****
ebal.resource_id desc;****
--Consider getting the asterisk key fixed, since it results in invalid SQL syntax -
Using Reporting Services Web Service methods to run a report with query parameters
I'm attempting to use the ReportExecutionService methods to process a report that contains four parameters, two of them query parameters. In total, the report must execute two queries. The two query parameters are determined by the execution of
the second query.
So, I've read about GetExecutionInfo and SetExecutionParams. To quote the MSDN page for GetExecutionInfo, "Use this method iteratively with the SetExecutionParameters method to evaluate parameters that have query- or expression-based defaults."
Can anybody explain how to use this, or any other method, to execute a report such as mine? The first query gets the rows of the report; the second query gets the row count. LoadReport does not seem to do the trick by itself. I need to use the technique
described in the quote above, I think.
I could really use some help. Thanks!Hello,
If I understand correctly, you create a local report which choose report from Report Server. You have two query parameters in the report which are returned by stored procedure. Currently, you cannot get default values for these parameters when run the report.
Based on my test, if we haven’t configure these parameter with Available Values, we can reproduce the same issue. Also, caching issue may cause the same issue. If the issue is persist, please delete the corresponding report in the report server. Then, redeploy
it to check.
There is a similar issue, you can refer to it.
http://social.msdn.microsoft.com/Forums/en-US/6a548d65-35d0-4a3e-8b64-3b7b655c76ee/ssrs-2008-report-parameter-default-value-doesnt-work-when-deployed
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support -
When we upgraded our SSRs projects to 2012, we are facing an issue in Data tools environment.
When we click REFRESH FIELDS button in Dataset properties, With query type as SP (For all our sps), the "Define query parameters" popup is not displayed.
When we checked the SQL Profiler for queries executed at back end , NULL values are used for parameters.
But when we Used the QUERY DESIGNER button, and clicked execute for sp, the popup comes.
For User defined Functions, the Popup comes correctly.
In BIDS, still we can open the RDLs and do the operations correctly
Please adviceDear Wendy Fu
My Scenario is different.
In Query Designer, Every thing is fine (Parameter Popup is coming, and fields are populated under data set)
But what we need to do is
1, Select Query Type As SP
2, Select the required SP
3, Click Refresh Button
4, A "Define
query parameters" window popsup
5, Provide values and click Ok
6, Fields will be populated under the dataset
The issue we face is that, we are not getting the Define query parameters popup,
Hence NULL values are passed to execute the sp, to retrieve the fields set.
The Work around we are using now is editing the sp, and use
set @Parameter = Value
for each parameters in sp, and then we get the fields populated under dataset, when we click refresh.
The issue exists in both MSDT for
Visual studio 2010 & MSDT for Visual studio 2012.
But every thing is fine in BIDS with VS 2008 Shell for the same RDL
Maybe you are looking for
-
It has been over a week since I click to open mozilla and it won't. This has never happened before. I decided to uninstall it and install it back again to see if it would work, but a window pops up and says to close it. I can't get it to open it, so
-
Restoring Apps AND Data back to "New" iPhone
I just got an iPhone 3GS a few weeks ago and, since I'd been using an iPod Touch for a year, I simply transferred over that data to my new iPhone using "restore from backup." Somewhere along the way I was also prompted to upgrade to iPhone 3.1.2. How
-
FCP crashes, and opening and saving projects take too much time
Since my upgrade to FCP 5.0.4 I’m having trouble on several aspects of FCP. I am using an Xserve raid storage, connected via fiberchannel to an Xserve with 10.4.4. The editing computers are connected via fiberchannel and Xsan to the central storage.
-
Can't get rid of border in database layout
I am creating labels from a database for the Cub Scouts. The database field is surrounded by a thin black border. I can change the thickness of the border, but I cannot get rid of it with the "no line" option. Is it possible? Appleworks 6.2.9; label
-
How to implement Inline Views in ODI?
Hi, How to implement the following query (inline view) in ODI? Query: SELECT * FROM Table_one t1, (SELECT * FROM Table_two (includes some where conditions) t2 WHERE conditions; How to set the conditions at the table level (not at the interface level)