Query Scenario Help - Average of Multiple Regions
Hi, I have a query scenario I can't create and I hope someone can help with.
The user inputs a sales Area and the report is to output the regions in that area and provide the Volume (easy) and the Average of all the presented regions. The problem is that the number of regions is dynamic so I don't know how to go about determining the average and making it constant across the regions. The user can also drill down on a region to present divisions and I would then need the average for the divisions this time instead of regions. Can you help?
Example 1
Input Sales Area 1000000
Region 1000001 1000002 1000003
Product1 Volume 100 120 105
Product1 Average 108 108 108
Product2 Volume 200 400 325
Product2 Average 308 308 308
Example 2
Input Sales Area 2000000
Region 2000001 2000002 2000003 2000004
Product1 Volume 100 120 105 180
Product1 Average 126 126 126 126
Product2 Volume 200 400 325 600
Product2 Average 381 381 381 381
To get this layout I have the following in the query builder:
The 2 Products are in a structue under Rows
The Key figures structure is also under Rows
The Region is under the columns
If you redesign the report slightly to move the "Average" to a column at the end of each row (which really makes more sense, IMHO), then the answer is easy. Just change the Suppress Results Row property to "Never" for Region, and change the Display Results As property to "Average" for Volume.
You could also make this same change to Division and/or any other free characteristic they might use as a drill-across in the report.
Hope this helps...
Bob
Similar Messages
-
One save button, multiple regions question
Hi. I have a question dealing with multiple regions in APEX 2.2. I would like to have a page with two regions. The top displays account transactions for the current period. Due to the nature of the application, there are a fixed number of transactions per period and all fit in one page.
The bottom regions displays the ROI value for the current period. It pulls from a table that has exactly one row per period. The period is always the same for the top and bottom region.
The current generation of the page shows the account transactions. The region was generated using the wizard and has a type of "SQL Query (updateable report)." As it, it works nicely.
When we added the new region for the ROI, we used the wizard, too. The ROI region has the same type ("SQL Query (updateable report)." We have just one SAVE button on the page and it does the submit.
The problem is that when we save, we get an error:
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process.
If we delete the bottom region then we don't get this error.
The fields that it shows are always from the top region, even if we're only updating the ROI. From what I understand, APEX thinks that the cached values have been updated in the database. Since we're testing on a dedicated box, I know that no one else is making updates. I've also seen this error when we've accidentally rearranged the order of the fields in the report query. I think that's not the case here since deleting the new region makes the page work as expected.
My question is how can we get the two regions to work together on the same page?
Thanks
MikeHi,
When working with report regions only one could be updateable report. You need to delete the region that's not updatable and recreate it as an non-updateable report.
If need to update another table use a process (PLSQL) called when your save button is pressed.
Hope could help you. -
Computing average accessing multiple tables
I have a teaser in creating a list of students and computing their average grade by accessing multiple tables.. can someone help me with this?
I have following tables:
class( class_id, class_name)
student(student_id, student_name, class_id)
exam ( exam_id , class_id , exam_date )
grade( exam_id , student_id, grade )
create a list of students and ther avg grade in their last N ( n can be any number ) tests
Any help in getting this sql will be usefulHi,
Welcome to the forum!
I'd approach the problem in these steps
(1) Join the tables to show all grades for all students: one row per student per grade
(2) Use the analytic ROW_NUMBER (or RANK, depending on how you want to deal with ties) to see which is the 1st, 2nd, 3rd, ... most recent for each student. (Let's call this number rnum).
(3) In a super-query, compute the average "WHERE rnum <= n".
Break these steps down, if necessary, and test that your query is doing what you want before going on to the next step.
For example, (1) is a lot to do at once. Take baby steps. for example:
(1a) Start with just the grade table. Write a query that gets the relevant onformation from the grade table. When that is working perfectly,
(1b) Add one more table (either exam or student will work). Make sure you're getting all the data you need from these 2 tables.
If you get stuck, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), your query, and the results you want to get from that data with that query. -
How to edit multiple regions in one Piano Roll window
I edit multiple regions in one Piano Roll window at the same time. (It is very handy way of editing especially in huge orchestra projects.)
I can see midi contents of all selected regions in Piano Roll at the same time.
1) But how to choose certain one region of many selected to edit it?
2) And how to edit all at once?
Hope the questions are clear enough.
Thanks.
Dmitriy.
iMac (27-inch, Mid 2011) 2,7 GHz Intel Core i5. 16 GB 1333 MHz DDR3.
OS X 10.10.2First of all, the Piano Roll has two mechansim, of what it is displaying.
Selected Track: This displays all the Regions that you select in the Tracks Window
One Track: Selecting one Region in the Track Area displays all the Regions of tha tTrack in the Piano Roll. If you select multiple Regions in the Tracks Window, then the last selected Regions counts.
Whatever Regions are now displayed in the Piano Roll Editor can be edited. Select the MIDI Events and apply the command.
You can also apply edits directly to the selected Regions in the Tracks Window.
I explain all those little details in my graphically enhanced manuals ("Logic Pro X - How it Works")
One thing to be clear about:
Tracks Window: Any edit is applied to the selected Regions
Piano Roll Editor: Ay edit is applied to the selected Events
Hope that helps
Edgar Rothermich
http://DingDingMusic.com/Manuals/
'I may receive some form of compensation, financial or otherwise, from my recommendation or link.' -
Configuration scenario of file to multiple IDOCs in XI
I have to configure a scenario of file to multiple IDOCs in XI.
I have XML file in MDM server. And it contains multiple segments. Each Segment is a combination of DEBMAS and ADRMAS.
So in XI configuration I have to separate the mapping for DEBMAS and ADRMAS. And my ADRMAS idoc should post first in R3 and then DEBMAS should post.
These IDOCs are multiple because each segment in XML file will be a IDOC.
Does BPM process is mandatory here or we can do in any other way.
Could you please suggest how to do this configuration. If you have any documents pls share with me.
Regards,
VenkatHi,
First you need to split the messages into multiple IDOC types. As you are going to send this to IDOC adapter, it is required to have BPM to split the message.
These 2 docs may help u:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cdded790-0201-0010-6db8-beb9bb2b2660
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
Regards,
Moorthy -
Set multiple Region Keys to one Region within Map component?
Does anyone know if multiple region keys can be tied to one specific region within a Map component?
Example -
My data contains the following values that i'd use as Region Keys (these are codes in my table that stand for cities within Taiwan):
1) TW/FJN
2) TW/KSH
3) TW/TWN
On the China Map Component I can set a Region Key for Taiwan. But is there a way to be able to set all 3 of the above listed values for a Taiwan Region key? Or am I only allowed to enter 1 value?
Here is a photo to help show what i'm talking about:
[http://img195.imageshack.us/img195/8508/gdsagdsasd.jpg]Does anyone know if multiple region keys can be tied to one specific region within a Map component?
Example -
My data contains the following values that i'd use as Region Keys (these are codes in my table that stand for cities within Taiwan):
1) TW/FJN
2) TW/KSH
3) TW/TWN
On the China Map Component I can set a Region Key for Taiwan. But is there a way to be able to set all 3 of the above listed values for a Taiwan Region key? Or am I only allowed to enter 1 value?
Here is a photo to help show what i'm talking about:
[http://img195.imageshack.us/img195/8508/gdsagdsasd.jpg] -
Cluster bar chart- sql query please help-
Hi,
I am trying to create cluster bar chart and am stumped with this sql query.Any help is appreciated.
Here is my table
city region issue value
c1 north i1 y
c1 north i2 y
c2 north i1 n
c2 north i2 y
c3 south i1 y
c3 south i2 n
c4 east i1 n
c4 east i2 n
The bar chart will have 3 series, north south and east.
And labels will be i1 and i2. value will be number of times this issue was encountered(y) in this region.
How can I get something like this from the above table-
region issue count(yes)
north i1 1
north i2 2
south i1 1
south i2 0
east i1 0
east i2 0
thanksWITH table1 AS
(SELECT 1435177 qte_id, 2 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no
FROM dual
table2 AS
SELECT 1435177 qte_id, 1 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 2 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 3 seq_no, 0 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 4 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 11 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no, 59300 cmmt_curr_amt
FROM dual
SELECT qte_id, t2_seq_no, cmmt_curr_amt - cmmt_curr_lag diff
FROM
(SELECT t2.qte_id, t2.seq_no t2_seq_no, t1.seq_no t1_seq_no, cmmt_curr_amt, LAG(cmmt_curr_amt,1,0) OVER (PARTITION BY t2.qte_id ORDER BY t2.seq_no) cmmt_curr_lag
FROM table1 t1, table2 t2
WHERE t2.qte_id = t1.qte_id (+)
AND t2.seq_no = t1.seq_no(+)
ORDER BY 1,2
WHERE t1_seq_no IS NOT NULL
ORDER BY 1,2
QTE_ID T2_SEQ_NO DIFF
1435177 2 0
1435177 5 0
1435177 7 0
1435177 8 0
1435177 12 0
1435177 14 0 -
Hi
If you have reports in multiple regions, Is it possible to print all the reports at once instead of indivdually in their respective region.
MarcoHi Dimitri,
I've done that on my OTN workspace app. I created the report query using "select empno, ename from emp order by 1". Did a page button and got the pdf as I would expect. I then went back and added a second query "select deptno, dname from dept order by 1", applied changes to save the query and again to save the report query. Went back to my page, and the pdf still only shows the emp report. Went back to the report query, the second select statement is definitely there but even the Test button only shows the emp query. Is there something else I need to do?
Andy -
Need help in creating multiple signature forms?
need help in creating multiple signature forms that can be digitally signed in adobe reader
Automator gets a bit unweildy when trying to vary things outside of what the actions provide. Since you are already using an AppeScript in your workflow, might as well do the whole thing:
set baseFolder to (path to desktop) -- the location to create the folder
display dialog "Please provide a new folder name:" default answer "test"
set folderName to text returned of the result
repeat -- keep repeating until a number is returned
display dialog "How many subfolders?" default answer "5"
set theNumber to text returned of the result
try -- test the result
set theNumber to theNumber as integer
exit repeat -- success
end try
end repeat
tell application "Finder"
try -- make new folder
set newFolder to (make new folder at baseFolder with properties {name:folderName})
on error number -48 -- skip errors if the folder is already there
set newFolder to ((baseFolder as text) & folderName) as alias
end try
repeat with X from 1 to theNumber
try -- make new subfolder
make new folder at newFolder with properties {name:folderName & X}
on error number -48 -- skip errors if the folder is already there
end try
end repeat
end tell -
11G ADF BC: How to arrange the position of items in a query scenario?
Hi,
I am creating a search page with a search scenario at the top and a result table at the bottom using Jdev 11G (11.0.0.0.1) ADF BC. In my search scenario, there are about 35 items. Now they are evenly divided in 3 columns by default. I have certain requeirement for the layout of the these items. But seems to me, they are not editable to the programmer. Does anyone know anything about this? Any idea is deeply appraciated.
Regards,
AnnieTimo,
Thank you for your reply and I am sorry that I did not say it clearly.
Yes, I use the "All Querable Attributes" under " "Named Criteria" under the "Data Control" Palette. So I do not think I have any control over those items in the query scenario under the "Structure" pane. They are completely hidden for me. Do you know any other ways to modify them? I mean to change the layout of them.
Regards,
Annie -
How to improve the performance of the attached query, Please help
Hi,
How to improve performance of the below query, Please help. also attached explain plan -
SELECT Camp.Id,
rCam.AccountKey,
Camp.Id,
CamBilling.Cpm,
CamBilling.Cpc,
CamBilling.FlatRate,
Camp.CampaignKey,
Camp.AccountKey,
CamBilling.billoncontractedamount,
(SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
rCam.AccountKey as AccountKey
FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
WHERE Camp.AccountKey = rCam.AccountKey
AND Camp.AvCampaignKey = rCam.AvCampaignKey
AND Camp.AccountKey = CamBilling.AccountKey
AND Camp.CampaignKey = CamBilling.CampaignKey
AND rCam.AccountKey = xSite.AccountKey
AND rCam.AvSiteKey = xSite.AvSiteKey
AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
to_date('01-01-2011', 'DD-MM-YYYY')
GROUP By rCam.AccountKey,
Camp.Id,
CamBilling.Cpm,
CamBilling.Cpc,
CamBilling.FlatRate,
Camp.CampaignKey,
Camp.AccountKey,
CamBilling.billoncontractedamount
Explain Plan :-
Description Object_owner Object_name Cost Cardinality Bytes
SELECT STATEMENT, GOAL = ALL_ROWS 14 1 13
SORT AGGREGATE 1 13
VIEW GEMINI_REPORTING 14 1 13
HASH GROUP BY 14 1 103
NESTED LOOPS 13 1 103
HASH JOIN 12 1 85
TABLE ACCESS BY INDEX ROWID GEMINI_REPORTING RCAMSIT 2 4 100
NESTED LOOPS 9 5 325
HASH JOIN 7 1 40
SORT UNIQUE 2 1 18
TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY SITE 2 1 18
INDEX RANGE SCAN GEMINI_PRIMARY SITE_I0 1 1
TABLE ACCESS FULL GEMINI_PRIMARY SITE 3 27 594
INDEX RANGE SCAN GEMINI_REPORTING RCAMSIT_I 1 1 5
TABLE ACCESS FULL GEMINI_PRIMARY CAMPAIGN 3 127 2540
TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY CAMBILLING 1 1 18
INDEX UNIQUE SCAN GEMINI_PRIMARY CAMBILLING_U1 0 1Hello,
This has really nothing to do with the Oracle Forms product.
Please, send the SQL or/and PL/SQL questions in the corresponding forums.
Francois -
Need help Setting up Multiple Static Ip , 1 for each port of the fios router
Need help Setting up multiple Static Ip on my fios router
I have been trying to figure out how to set up multiple ip in my fios router.
However I kind of managed how to set up multiple static ip However the way I want it is for each port of my router to have an external ip signed to it. ( like 4 different modem in 1 )
Verizon gave me 5 static ip but they can not help me how to set it up.
Have anyone here done more then one static ip on different ports? I assume that the process will be the after the second static ip.You want to set up Static Nat. You will not assign the IP to a port, but rather to a local machine. Figure out what machines you want your IP's to go to. Under the firewall section you will see static nat. Pick the machine you want and enter one of the IP's you were assigned.
-
Hi all,
I have a select query scenario.
For example in a ztable
I have two fields A and B
it holds records like
A B
3 5
2 10
7 12
if my input is 4
I wrote a query like
select * from ztab where ( a <= input and b >= input ).
But its not working
The problem is its picking both the record
3 5
2 10
but my output should be
3 5
Hope its clear ..
I know that this could be acheived using a select and a delete from itab.
But i need to acheive this through single select.
Any ideas ..Hi,
If the data comes from a Z table and the fields are numeric by nature (as the name "bankkey" might imply), then I would really recommend adapting the data type in the table, making the fields numeric. Working around the data type in your code (which technically you coudl do by a MOVE from the C field to a numeric field) would be clumsy and you'd have to do it in every program thet accesses this data.
Regards,
Mark -
Removing Interval in the value help of the Multiple selection in WD4A
Hi All,
Please help in the way to remove the interval in the pop-up of the value help of the multiple selection in the select option of the web dynpro ABAP.
Also help me selecting the complex restrictions Via: I_COMPLEX_RESTRICTIONS in the below code.
wd_this->m_handler->add_selection_field(
i_id = '/SCMTMS/BUPA_INTERNAL_ID'
it_result = lt_range_table
i_read_only = read_only
I_NO_INTERVALS = ABAP_TRUE
I_COMPLEX_RESTRICTIONS = lv_res
Thanks in advance ,
Selvakumar M.Hi Selva,
For removing the interval set the parameter 'i_no_intervals' of method add_selection_field to true.
Complex restrictions has following parameters.
l_complex_restrictions-m_include-eq = abap_true.
l_complex_restrictions-m_include-cp = abap_true.
l_complex_restrictions-m_include-ge = abap_true.
l_complex_restrictions-m_include-gt = abap_true.
l_complex_restrictions-m_include-le = abap_true.
l_complex_restrictions-m_include-lt = abap_true.
l_complex_restrictions-m_include-ne = abap_true.
l_complex_restrictions-m_include-np = abap_true.
l_complex_restrictions-m_exclude-eq = abap_true.
l_complex_restrictions-m_exclude-cp = abap_true.
l_complex_restrictions-m_exclude-ge = abap_true.
l_complex_restrictions-m_exclude-gt = abap_true.
l_complex_restrictions-m_exclude-le = abap_true.
l_complex_restrictions-m_exclude-lt = abap_true.
l_complex_restrictions-m_exclude-ne = abap_true.
l_complex_restrictions-m_exclude-np = abap_true.
You can set the value of these as desired. Also pass i_use_complex_restriction parameter of method add_selection_field as true while using complex restrictions.
Regards,
Pooja -
Hi ,
I need query for moving average the same as B1 calculate it.
IdanHi Idan,
Moving Average Rate Calculation
Moving Average Rate = Daily Receipt Value / Daily Receipt Qty
This Rate generate on daily bases.
Its called in SAP as Lastevaluated Price
Thanks,
Srujal Patel
Maybe you are looking for
-
I installed Photoshop, and it automatically installed on the C: disk (Windows 7). The C: disk has only 11 Gb left, and I think that's the reason that I get warnings about a full scratch disk. So I rather install Photoshop on E:. So I reinstalled ever
-
Antes de nada mis disculpas si esto no va en este apartado. He estado buscando algún sitio donde ponerlo y no se me ocurre. Estoy utilizando un API para leer PDF y mostrarlos en una aplicación java con Swing. Encontré un bean de acrobat aunque no se
-
Search Page based on select Query...
I want to create a simple search page base on a select query. The select query will not be based on Table.Its based on functions. I have created a view object like this select xx_test_accruals(:p_date) ACCRUAL,:p_date DT from dual I have created a Se
-
TS3868 iMovie icon in the dock is missing
I have "lost" iMovie. When I try to connect, it says that it "damaged" or "incomplete. I have done nothing with iMovie for weeks, yet now it is unavailable.
-
Using LSMW how to handle Value contracts create/change (VA41) /(VA42)
Hi Experts, Please suggest me how to create and change of value contracts using LSMW. Actually i got one standard batch input program RVINVB10 in LSMW for create/change for value contracts. but the problem is one field ZWERT - Target Value in Docum