Query regarding display values
Hi,
I Have a Table with column name as
agent_name
guest
billing
i have to display report as
2010 2009
Agent_name guest billing guest billing
abc 209 5000 300 6000 //209 is the count (guest),sum(billing) group by agent name and year
guest and billing is the single column in table and i have to display only top ten rows in desc order with maximum of billing.
i am not able to write code for this query. please help me to show these value.Edited by: 805629 on Feb 21, 2011 5:36 AM
Edited by: 805629 on Feb 21, 2011 5:38 AM
Please consider the following when you post a question. This would help us help you better
1. New features keep coming in every oracle version so please provide Your Oracle DB Version to get the best possible answer.
You can use the following query and do a copy past of the output.
select * from v$version 2. This forum has a very good Search Feature. Please use that before posting your question. Because for most of the questions
that are asked the answer is already there.
3. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
I have the following table called sales
with sales
as
select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
union all
select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
select *
from sales 4. Rather than telling what you want in words its more easier when you give your expected output.
For example in the above sales table, I want to know the total quantity and number of invoice for each product.
The output should look like this
Prod_id sum_qty count_inv
1 145 2 5. When ever you get an error message post the entire error message. With the Error Number, The message and the Line number.
6. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
use the {noformat}{noformat} tags.
The usage of the tag is like this.
<place your code here>\
7. If you are posting a *Performance Related Question*. Please read
{thread:id=501834} and {thread:id=863295}.
Following those guide will be very helpful.
8. Please keep in mind that this is a public forum. Here No question is URGENT.
So use of words like *URGENT* or *ASAP* (As Soon As Possible) are considered to be rude.
Similar Messages
-
Query regarding displaying of a blank page on the output of an invoice
hi All,
I am facing a problem in both my development and staging servers. Whenever a print preview of an invoice is seen, there are 3 pages getting displayed (depending on the data) with one BLANK PAGE between 2 pages having data ie., First page has the data, second page is blank and third page has some data again.
Now its very strange and i could not understand why this problem is arising.
I had debugged the invoice SAPScript, but culd not find the issue,. Can anyone please help me out in this regard.
Regards
Priyahi!
hav u assigned the next page for ur first page as wanted.....
or u r calling two pages explicitly by new-page then check the page assigned and check for spaces in ur program..... -
Query Regarding Displaying Data
Hi ,
I have one table tblugatewaycdr.
table having cdr records.
invoice number callednumber date accountedcost
200900006438.00 96614727373.00 1-Jun-09 6
200900006438.00 96614727373.00 1-Jun-09 - 6
200900006438.00 96614727373.00 1-Jun-09 - 1310
200900006438.00 96614727373.00 1-Jun-09 1310
200900006438.00 96614727373.00 1-Jun-09 -1310
200900006438.00 96614727373.00 1-Jun-09 38
200900006438.00 96614727373.00 1-Jun-09 38
200900006438.00 96614727373.00 1-Jun-09 -38
Now i have to take only one positive and one nagative value accountedcost.(in pair +6 and -6, 1310 and -1310)
kindy provide me appropriate solutionIs that not just a case of selecting DISTINCT values?
If you're after something more then perhaps you'd better explain in more detail.
Also, when you paste code or data put the tag {noformat}{noformat} before _and_ after it so that it maintains it's format on the forum. -
Variable input values in the query are displayed wrong
Hi experts,
I executed a report and in the variable input screen it asks for a key date and company code.
We entered key date and company code and executed the report.
We want to take a print out of the output. But the variables which we entered in the variable screens are
dispalying wrong. i.e if we have entered company code as gsml and key date as 01.01.2008.
In the report output I am getting as:
Company code: gsml
Keydate: #..27-11-4745
But keydate should be displayed as 01.01.2008
How to solve this ?
Regards,
Nishuv.Nishuv,
Please follow below steps:
1. Open query through Bex - Query Designer
2. Beneath the Rows Area( where you actually drag in charactertistics), you'll be finding two tabs Filter and Rows/Columns
3. Click on Filter Tab
4.You'll be navigated to a window, there you can trace two Workareas
a. Characteristic Restrictions: Where drag in the relevant Prompts/Input Variables
b. Default Vaules
5.First, Drag the required promts/Input Variables in Characteristics Restrictions.
6.Click on the varible which was dragged in Characteristic Restriction area and drop it into default values area.
7.Now you'll have visibility of variable in two regions, Characteristics and Default Values.
8. Save and Execute the Query
Regards,
Yaseen -
Pass displayed values to query
Hello all,
I have a WebTemplate with a Query displaying the top 15 customers according to some key figures.
Under this query I have a link to another Query and I want to pass the displayed values (top15 customers) to the second Query where data should only be shown for these customers.
How can I pass the displayed values to the other query in the link?
If the variable that should be filtered in the second Query is VARIABLE2, the link should look like this:
"&FILTER_IOBJNM=VARIABLE2&FILTER_VALUE=?" in the link but how do I get the displayed values into the link for the FILTER_VALUE?
Best Regards,
Fabian
Edited by: Björn Rose on Apr 15, 2008 4:26 PMThanks a lot! That was what I was searching for.
Best Reagrds
Fabian -
Taking display value for calculations using structures in Bex query
Hi
I am using Bex analyzer to do a simple report with two key figures Sales and Plans from cube and two more calculated key figures Abs Deviation and % error. The report displays at category and product levels. Category is higher and one category contains multiple products.
The simple formulas for the two calculated KF are,
1. Abs Deviation = Abs (Sales Plans).
Abs Deviation is set with the property Calculate result as summation to add up Abs deviations at product level to show at Category level.
2. % Error = Abs Deviation / Plan.
The issue is with the % Error value at category level. At product level, all the values are showing correctly.
To illustrate the issue with a simple test case,
CategryProductSale-PlanAbs Dev----%Error
C1--P1--100-60---40--
67%
C1--P2---50120---70--
58%
C1 Total--150180---110--
17%
Observe that in the output the calculation for %Error at product level is correct all the way. But the summary
calculation for Error% i.e. C1 total which is showing as 17% is wrong. The correct value as per the formula should be 110/180 = 61%.
SAP, through OSS replied that it is not a bug but the default behavior of OLAP calculation. OLAP processor first calculates the formula for % Error and then shows the display value at C1 total for Abs Dev. Meaning, % Error is calculated first and next the summation for Abs dev is displayed. Abs dev 110 at C1 level is only a display value but not the value taken for % Error at C1 level. Instead OLAP calculates the Abs Dev at C1 level by Total sale Total plan = 180 150 = 30 and the % Error calculation takes this 30 value in the formula and gives % Error = 30/180 * 100 = 17% at C1 level. But 17% doesn't make any sense to the user. Further, to display value of 61% at % Error at C1, it is being advised that by defining two structures, I can force the calculation to take display value of 110 in the % Error calculation at C1 level by using the cell editor.
Has any body tried to achieve similar result as above by defining two structures and cell editor in the query? If so, can you please throw some pointers of how to define two structures in a query and how to force the % Error at category level to take the display value of 110 in the calculation? I have gone through the documentaion on structures and cell editor but the approach is not at all clear.
Thanks in advance for your suggestions.
Prasad
Unilever Asia IT departmentHi,
Have u read aabout the Formula Collision.
Take a look on this link .
http://help.sap.com/saphelp_bw32/helpdata/en/d2/02223c5f00612be10000000a11402f/frameset.htm
Read the Formula Collision, and let us know , whether your pb is solved by changing the Formula Collision of % error formula.
With rgds,
Anil Kumar Sharma .P
Kindly assign points , If it really helps you. -
Query to display one row per group based on highest value
I have the following table and I want to be able to create a query that displays only the highest number based on a group. (see below)
Acode
aname
anumber
a
Jim
40
a
Jim
23
a
Jim
12
b
Sal
42
b
Sal
12
b
Sal
3
Acode
aname
anumber
a
Jim
40
b
Sal
42Multiple ways
using aggregation
SELECT Acode,aname,MAX(anumber) AS anumber
FROM table
GROUP BY Acode,aname
using subquery
SELECT Acode,aname,anumber
FROM table t
WHERE NOT EXISTS (
SELECT 1
FROM table
WHERE Acode = t.Acode
AND aname = t.aname
AND anumber > t.anumber
using analytical function
SELECT Acode,aname,anumber
FROM
SELECT *,ROW_NUMBER() OVER (PARTITION BY Acode, aname ORDER BY anumber DESC) AS Rn
FROM table
)t
WHERE Rn = 1
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Display values of a single field in a multiple rows in a table region
Hi Tech-Gurus,
I want to display values of a single field ( which is in a table region) in multiple rows and also need to restrict the values from decimal number. If i click save, then it will throw exception "Decimal not allowed".
xxxxxx
yyyyyy
Reg.No
1234
5678
7654
I need to display the values of REG.NO in different rows like,
1234
5678
7654
and also need to validate as well against Decimal values.
Please help me with the code how i will iterate ?Hi,
I am assuming you are talking about displaying substrings from the Reg No in different rows. For this you would need to write a query which identifies the substrings and creates a separate row for each (ensure you choose values for all other columns in the table row). Kindly let me know if the understanding is incorrect.
To validate against decimal value you can use the java code by checking the difference of the number and the number on which modulus has been applied. Hope that helps.
Regards
Sumit -
Sales Order form error "Not able to retrieve Display values for Service"
Hi,
Few of our orders flash the below error message when the order is queried
"Not able to retrieve Display values for Service"
Below are the points I observed
1.The orders I am referring to are imported order via EDI interface.
2.The service reference type code has value of ORDER, however no other service related fields (like service reference line id) have any values.
3. The item is not a service item (service tab in Item setup is disabled)
4. Same item when imported with value of "Customer Ordered" in "service reference type code" field, does not throw an error.
5. If I update "service reference type code" with value null or change it to CUSTOMER_PRODUCT, the error disappears.
Can someone explain the significance of this column value and what could have been causing this error message?
May be there are some dependent fields/setups which must have a value when service reference type code =ORDER.
Thanks in advance,
JC
Edited by: user10174990 on Oct 25, 2012 10:58 AMHi,
Maintain the dafault values using Tcode OISF with respective to Planning Plant you have to maintain the following values like Order Type, Main Work Center, Maint. Plant,Group,Group Counter,Business Area & Task List type.
or
Apply these OSS note 150732 / 195993.
regards,
Venkatesan Anandan -
Fiscal Year Period - Query Designer - Characteristics Value
Hi Experts,
In query designer, characteristics value for 0FISCPER by default shows value of fiscal year variant V9. But for Fiscal year variant V9, 002.2014 is November 2013.
Now user want to display the correct period and its description (002.2014 is February 2014) which implies need to use different variant. Please let me how this can be changed.
Regards
Suresh KumarHi Suresh,
Try this
Path: Financial Accounting >> Financial Accounting Global settings >> Fiscal Year >> maintain Fiscal year variant (maintain shortened fiscal year)
Transaction Code: OB29
Regards,
Amit -
Query contains double value - seems cache problem
Hi experts,
in a Query (integrated planning) based on an Aggregationlevel based on a Multicube.
The Multicube contains an Realtime InfoProvider to store planning data and a normal InfoProvider to show actual values.
The load of actual values to the InfoProvider can be executed several times a month via ProcessChain -
it´s a full load so the data loaded before will be deleted during the month in order to save the new monthly dataload.
In the Query there were double values displayed for actual data after several loads during the month -
but in the acutal InfoProvider only a single value is stored!
It seems to be a buffer problem, since a deletion of all system buffers solves the problem - but this is not the way to handle the problem in productive area.
How can the problem be solved?
Setting of Planbufferquery of acutal data InfoProvider to not using Cache doesn't help.
Thank you!
AngieHi,
there is no data stored in acutal cube and the query column is restricted to actual cube.
And actual cube only contains the value once, but the query can display the double value.
If all buffers are reset, the query shows correct value - but this is not the way to handle the problem.
What changes need to be made?
Is there a setting in query cache or planningbuffer query cache or some other setting that can fix the problem?
Best regards,
Angie -
Scale Maker Display Value At Mouse Pointer
[http://picasaweb.google.com/lh/photo/lpP1mX7pTd4R_ePr89fw7w0hA5i5v2I0J6LQTHStSe0?feat=directlink]
Hi ,
I have used Scale Marker in the Line Graph(Image link attached) using a SQL Query.
Sales Fact(second Line) on the graph displays Value when mouse is pointed but for Marker line this does not happen.
Can any one suggest a method to resolve this?
Regards,
SreekanthJohn,
I wanted to avoid taking the column as u suggested in Criteria because its causing a Cartesiona product ex:
Select Target_Value,Quantity_Sold from sales,Target_Ref where Sales.rowid<> Target_Ref.Target_id.
I wanted to avoid this by pacing the Select Target_value from Target_ref query in scale Marker.But my client requires wants data lables to be displayed for Scale marker too.
Regards,
skarangi -
Query to display data monthwise and calculate total for first 12 months
Hi All,
I have a query that displays forecast data monthwise.
This has been achieved by adding 0CALMONTH on top of key figure structure.
Eg: -
APR 2011 MAY 2011 JUNE 2011 ....... NOV 2013
Forecast Forecast Forecast Forecast
PRODUCT 1 10 15 20 25
Now there is a requirement to include new column that displays total of first 12 months data only.
How can I achieve this without repeating the total value for every value of 0CALMONTH?
Eg: -
APR 2011 MAY 2011 JUNE 2011 ....... MAR 2011 TOTAL of APR 2012 ....... NOV 2013
Forecast Forecast Forecast Forecast 12 months Forecast Forecast
PRODUCT 1 10 15 20 25 300 10 30
Any inputs will be appreciated.
Thanks & Regards
ManishaHi,
As far as i understand your requirement is to make a new keyfigure which has to be total of 12 months and that keyfigure should not get splitted based on calmonth which you have kept above the key figure structure in columns.
I dont think it will be possible to achieve it that way.You need to make a fixed structure which will dispaly data for say next 12 months or whatever your user requirement is and you need to make a seperate keyfigure with month offsets and then you can make a seperate total keyfigure(of 12 months).
With the help of text variable type replacement path you can get the seperate month names for all your forecasted keyfigures.
I had the same requirement but my user wanted to see the next six months data only so i made it with the help of month offsets.
If you get any other work around to achieve your requirement then please do share the solution with us.
Hope it helps.
Regards,
AL
Edited by: AL1112 on Sep 6, 2011 9:34 AM -
Hi all,
I have a query regarding the Pagination in the table component.I have a table and this table has been paginated with size 5. I am using an ObjectListdataprovider for populating data in table.Here i populate the ObjectList from another page and show it here in another page.Here we can chane the data.when i am clicking on the save it only considering the first 5 values dat is currently showing.This thing happens only when i didn't go the the second page using page navigation buttons.That is it ony saves the data that got focus.Can anyone have any solution?Please help me..
Thanks and Regards
SreeDo you have a message group component on the page to display runtime errors?
Did you check the server log (right-click Deployment Server and choose View Server Log) to see if any errors show up there?
Do you have any table colomn components bound to non-string fields? If so, did you drop the right type of converters on those components? -
Hello BW experts,
I am having an issue where in my query is not displaying data even though there is data in the cube in production.
But the same query is displaying data for the same selection in QA system.
I have executed the tests in RSRT, but am not able to find anything.
Please give your valuable inputs.
Thanks in Advance
BW learnerHi,
Check the filters of your query, Is there any selection made where you are going to get only march data which is present in your production system.
Check the info cube data by giving the same filter values as in the query definitation. If you didnt find any data, then your query is working fine.
check this and let me know...
if you find some data in the cube with the same filter selection, then give me the data flow of your query, which means, whether the query is executed on Multiprovider or cube?
Regards,
Patil.
Maybe you are looking for
-
Payment budget is getting updated at the time of Invoice
Hi, I have a peculiar problem in Funds Management. As per the client requirement payment has to made in split i.e. 90% and 10% against the invoice amount raised. But, payment budget is getting updated at the time of invoice itself when i use the prof
-
Hey all, I need a simple image gallery to load when you click a button. I've tried shadowbox but have had absolutely zero luck. I'm not sure how to load it from a flash file and I know there is work that has to be done outside of flash like in the r
-
Keyboard doesn't work in Finder
Hi all. Yesterday my keyboard stopped working in Finder. I had a look on the forums and found a fix which was to delete the com.apple.preferences.finder file, or whatever it was called. However, this fix has only worked till today! Finder again refus
-
Im creating a search for a image gallery and I want it to be able to pull up an image based on the keyword assigned to the image you searched. I have 4 fields in my DB, (id,layout"or image",description,key_words). My problem is when I enter a keyword
-
When I plug my hdmi lightening converter into my iphone5 I get an error message that states " downloading accessory firmware. Your accessory will not function until download completes. How can I fix this?