Report based on the result of the sorting function?
Dear all,
I will make this issue in general terms:
We have a report based on a query that reads data from a single table (P). It will take to provide a field more (X) in the report which is obtained using more than two tables (E, 1 m approx).
I wrote a function that produces this extra field based on a join of tables E and P1. Please note that this function depends on the report query variables. This output is correct and provides all the necessary information, but it is necessary to sort the report based on the result of this function, i.e. the value of field X.
Is this possible?
I appreciate your comments.
Note: I've tried incorporating pictures E, P1 in the request report (I can then sort on the required field) but gets reduced the number of lines in the report. This is because the join between the tables, P, E and P1 reduces the number of lines (which is not the correct result).
Yes, it is possible. If you have ended up above a formula column.
Create the formula column. For example, CF_SALARY_TOTAL. Place a level to the top of the query and set your desired sort (Asc/Desc)
Hope this helps
Hamid
Tags: Oracle Development
Similar Questions
-
How to create a report based on the item selected from the list of selection?
Hello
I created a tables_LOV based on:
Select table_name table_name user_tab_cols r, d
where column_name like '% _type % '.
Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.
I run the page, and I can choose the table I want in the drop-down list.
How to create a report based on the selected element? (ex: select * from selected_table)
Thanks in advance
Salah
Hi Salah,
Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.
The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION
To recreate my example, you should:
(1) create a report (interactive) on your collection
SELECT * FROM APEX_collections WHERE collection_name = 'MY_COLLECTION'
(2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")
(3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:
declare l_query varchar2(4000); begin l_query := 'select * from '||:P38_TABLES; if apex_collection.collection_exists ( p_collection_name => 'MY_COLLECTION' ) then apex_collection.delete_collection ( p_collection_name => 'MY_COLLECTION' ); end if; apex_collection.create_collection_from_query ( p_collection_name => 'MY_COLLECTION' , p_query => l_query ); end;
Make sure that you add your page_item 'Page to send items' section.
(4) add a real extra action that makes an update of the report area.
Here are two photos describing the da:
http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG
http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG
Good luck and greetings,
Vincent
-
The column report based on the build option
Hello
is it possible to display a column of report based on the selected build options?
I can exclude the elements or even a full page by adding a compilation option, but I couldn't find any way to exclude a column of a report according to a compilation option (for example not displayed this column if the build option is xyz).
Any ideas?
Thank you
JochenJochen:
I have not tested, but creating a condition for the column based on the APEX_APPLICATION_BUILD_OPTIONS could provide a solution.
CITY
-
Selective display of a report based on the value of a Variable of presentation
Hello
Is it possible to selectively display a report on a dashboard page based on the value of a variable presentation.
I have 5 reports that are part of the same page that has a page with 5 options-level prompt.
According to the option selected in the command prompt that the value is stored in a variable of the presentation, I need only 4 reports to view at any time (ie 1 report should NOT be directed).
Example: -.
When Option 1 is selected 1,2,3,4 reports must be posted
When Option 2 is selected 2,3,4,5 reports must be posted
Thanks in advanceHello
Search this Guided Navigation forum. In this way, you can hide a section on your dashboard based on the results of a report that is "hidden".
Good luck
Daan Bakboord
-
Bug in the classic report based on the function?
A simple example, suppose I want a classic report in which I can change the sort field by selecting in the P1_SORTFIELD element. Apex 4.2, I was able to implement the report using the PL/SQL function
return "select ENAME, SAL from EMP by | : P1_SORTFIELD;
I can't do that in Apex 5 on my workspace apex.oracle.com. I either get a runtime error "SQL command not completed property" if I use generic column names, or 'not all variables' if parse error I do not have.
My real application use generic column names, so I am more interested in a solution to this. For example, I tried to create a report with the source
return "select ENAME from EMP by ENAME;
If I run using the generic column names I always get the runtime error "command SQL not successfully completed.
Is this a bug?
Ed Sciore
Hi Ed,
I ran your application in debug mode and displays the following error output.
show report determine column headings ...Execute Statement: select ENAME, SAL from EMP order by ename order by 1 nulls last Logging exception: Sqlerrm: ORA-00933: SQL command not properly ended Backtrace: ORA-06512: at "SYS.DBMS_SYS_SQL", line 1445 ORA-06512: at "SYS.WWV_DBMS_SQL", line 464 ORA-06512: at "SYS.WWV_DBMS_SQL", line 475 ORA-06512: at "APEX_050000.WWV_FLOW_DYNAMIC_EXEC", line 411
See the other "order by null 1 last" that is added to your statement. This is what the origin of the problem. The additional order by is caused by the "Sortable" indicator enabled for your columns. If you disable the sort, because will work you who control in your SQL statement in the report well.
I'll take a look tomorrow, if we had a different behavior in 4.2 to automatically disable these flags and how it is actually easy to determine safe at the time of the design that your pl/sql function returns a SQL statement with an ORDER BY clause.
Concerning
Patrick
Member of the APEX development team
-
Title of the report based on the value of the Table column
Hello
We use OBIEE 10 g.
We have a Table and a chart based on the table in a report.
Assume that the table has two columns, ID and NAME
can we refer dynamically the value of the column NAME in the title of the report?
for example
the table has
ID | NAME
-------------
123 | GS
now, we would like the title to appear as
Report for the GS
where GS is dynamicUse the narrative mode and refer to the column that you want to display using @2 and place it instead of view title.
Thank you
Isabelle RenonPublished by: Rajesh Raoul - BI on May 2, 2013 05:59
-
Refresh the report based on the select list item
Hello world
Someone has the answer to refresh a report based on an element that I select in a select list? I currently have the item in the list of selection and a report under him I wrote a sql that fills with data. If I choose an article in my select list, I want to change the data in my report. What I have to write separate sqls for each item to be fired or write some type of process. Can someone help me?
Thank you
RyanWrite directly in the SQL report. Your select list item will be the variable in the SQL.
-
Conditional display of interactive report based on the different SQL query
Hello
I have two drop-down list at the top of my page and below I have an interactive report.
Based on the selection of the user from the drop-down list values, interactive report should change based on different SQL queries.
Is it possible to have different SQL queries based on the drop-down list values and generate interactive report based on that?
Thank youHello
You can't have IR based on function returning the query as you can have classic report
But here is a workaround
http://www.oracleapplicationexpress.com/tutorials/71Kind regards
Jari -
How to create a report based on the selection of a node of a tree
Hello
I am new to Oracle Apex and tried to build a tree and also an interactive report based on column empno from emp table.
I created a tree based on the emp table. Now, I want to see the records in the employee selected in the tree.
This is the query of the tree:
Select case when connect_by_isleaf = 1 then 0
When level = 1 then 1
of another-1
end the status,
level,
'ENAME' as the title,
NULL as an icon,
'EMPNO' as value,
NULL as ToolTip,
NULL as link
of ' #OWNER # '. " EMP.
Start by "MGR" is nothing
connect prior "EMPNO" = "MGR".
siblings arrested by 'ENAME '.
Can someone tell me step by step how to go from here?
I tried to follow the thread but could not understand a lot of it.The approach to reload the page and display the report is fairly simple.
- You start by creating a new page element that will be used to store the selected node ID, for example. P100_SELECTED_NODE (you can do atext element and change hidden once everything works as expected)
- Change the query of the tree and the link column in the SQL of tree definition to a link to the same
for example if your page is 100, you'd do the tree node a link to the same page but the value of the P100SELECTED_NODE with id_ of the node selected
This is done here
{message: id = 4410987}
In this case, it would be' f ? p = & APP_ID.: 100 :'|| : APP_SESSION |': P100_SELECTED_NODE :'|| EMPNO as link
Now when you click on a link to tree node, it would be back to the same page, but set the P100_SELECTED_NODE with the empno of the clicked node.
- All that's left to do, change your report so that it refers to the new point inorder to filter records for this employee empno i.e
SELECT ... .. WHERE empno= :P100_SELECTED_NODE
-
to limit the reports based on the responsibility of the user
Hello
is it possible to limit the reports displayed in the request for enforcement THAT LOV based on the responsibility of the user
for example a person in operations are not able to see the report, which belongs to the admin of the lov
kindly guide me
thanking in advanceis it possible to limit the reports displayed in the request for enforcement THAT LOV based on the responsibility of the user
for example a person in operations are not able to see the report, which belongs to the admin of the lov
You can achieve this by creating a new responsibility and exclude these concurrent programs of the Group requested that is attached to this new responsibility. Then assign the new responsibility of the user.
Thank you
Hussein -
Report based on the return values from checkboxes
Hi guys,.
I have a question about the boxes and a report.
Is it possible to create a report based on a list of dynamic control, where I can score different points of the brand. for example:
With a radio group ii without problem and when I mark only 1 entry in the list of control that works too, but I would like to have the ability to mark more than one entry and validity of these marked entries that the report should be implemented...select * from table where colomn <> :PX_CHECKLIST
If anyone has an idea how to get account, please let me know.
Should I create a box separated each entry area to be able to refer to them?
Thank you
PatrickHi Patrick
We are working on the same problem... ;-)
I'spent 2-3 recent
days attempted to understand how to treat the boxes in a tabular form
Looks like you had the same problem
My solution is...
The checkox "ChkBox" returns the values 36:58:423:46:422:421 etc.
This box is passed to a function of package 'GetEquipmentSql (ChkBox-online pArr2)"used s Source for a Pl/Sql statementFunction GetEquipmentSql (pArr2 in Varchar2)
Return Varchar2
as
When Varchar2 (2000);
Wselectionnez Varchar2 (2000): = ' Select re. Room_Id, r.Name, Count (1) of Room_Equipment re, Hall r';
Win a Varchar2 (2000);
l_vc_arr2 APEX_APPLICATION_GLOBAL. VC_ARR2;
BEGIN
l_vc_arr2: = APEX_UTIL. STRING_TO_TABLE (pArr2);
If l_vc_arr2.count > 0 Then
FOR z IN 1.l_vc_arr2.count LOOP
If z > 1 then
Win: wIn = | ',';
end if;
Win: wIn = | l_vc_arr2 (z);
END LOOP;
Wselectionnez: = Wselectionnez | «where are.id = re.» Room_Id';
If l_vc_arr2.count > 0 Then
Wselectionnez: = Wselectionnez | ' and re.equip_id IN ('| win |') ' ;
End If;
Wselectionnez: = Wselectionnez | When;
Wselectionnez: = Wselectionnez | "Room_Id group, r.name';
Wselectionnez: = Wselectionnez | ' Having count (1) > = ' | l_vc_arr2. Count;
On the other
Wselectionnez: = "Select Room.Id, Name, 0 from Room;";
End If;
Return (wSelect);
END;The function returns
*' Select Re. Room_Id, r.Name, Count (1) of Room_Equipment re, Hall r where are.id = re. Room_Id and re.equip_id (36,58,423,46,422,421) GROUP of Room_Id, r.name'; *I did it the easy way, I showed you the code
Do you understand my solution?
/ Gunnar -
ICP reports based on the accounts of the plug
Dear,
I would like to implement the ICP reports by inserting the plug only.
I have a progressive consolidation. I have to create a separate tree when entities are included in a flat way?
TX!
Hello
There is no reason for a separate tree.
The eliminations take place to the first common parent. So, if you create a report that verify one entity against each other, the system should produce the correct differences. Since you are using the account of the shooting, pay attention to the account of each account type attribute.
-
the detailed report based on the selected value
Hello experts,
I use 10g obiee.
I have a requirement were on the dashboard there are 4 guests say product, region, year, color.
All are select muli-value prompt.
on the dashboard, there is a synthesis report that reflects the value according to the selected data from the command prompt. His work so far.
Now below the customer wants a link that has the title of 'detailed report '. When they click the hyperlink, they want to see detailed but it show only the values selected in the command prompt.
They claim as detail as there are more number of columns found in the report detail than the summary report following.
Can we can suggest me how to achieve in 10g.
Thanks a lot for your help.Hello
Just add your detailed report to the dashboard as a link or an Image and keep the required columns, you are invited into the report. It should work.
Thank you
Gerard -
Change the report based on the selected value frm the prompt
Hello
I have a requirement where we invite dashboard that has three columns namely year, month, and report the name.
The user will choose the name at the prompt report, once made the report that was selected should appear
on the dashboard page and he should be able to select the data on the basis of the month and the year of it.
Also, if the user wants to go to the other report it should be able to select in the guest and view it.
Pls enlighten us on the way of progress on this issue. From now on, think that if something like this is possible, then it would definitley
need two prompts a report name and one for the month and the year.
THX :)Are you looking for this?
http://oraclebizint.WordPress.com/2008/01/17/Oracle-BI-101332-selecting-reports-from-Dashboard-prompts-and-guided-navigation-sections/
-
County, based on the soundex function
Hi all
I a bit confused with request asked of me.
the query is
indicate the account number of the last part of each word in the same row according to the soundex function
for example
the first line has set out four in the same line
Does it say I have divided the each statement and get soundex for the last part which is located in this example is------.ACD BCD AAA AFD BCF BDE AAC AFC BCF AAE
So the soundex only for AAA and AAE is same average I've update table b in the column of Gen by two and son on for others.AAA BCF AFC AAE
The result iscreate table a(id number(9), Gen_Value varchar2(200)); insert into a vlaues(1, 'ACD BCD AAA, AFD BCF , BDE AAC AFC,BCF AAE'); insert into a vlaues(2, 'AVF BCD, BBA BBG BCEV, GACD MNF BCV'); insert into a vlaues(3, 'AFC ABC, BBG HUH ABCE, JHU KK MNK'); create table b(id number(9), Gen_Value varchar2(200), id number(9)); insert into b values( 'AAA', '0',1); insert into b values ('BCEV ','0',2); insert into b values ('AFC','0',1); insert into b values ('BCD','0',2); insert into b values ('MNK','0',3); insert into b values ('ABCE','0',3);
see you soonGen count id AAA 2 1 BCEV 2 2 AFC 1 1 BCD 1 2 MNK 1 3 ABCE 2 3
Benjamin
Published by: 973907 on November 29, 2012 12:54 AM
Published by: 973907 on November 29, 2012 12:55973907 wrote:
We choose one of them. 'AAA' or AAE. or the word that has long term.No prob
with data as ( select id ,gen_value||',' gen_value from a ) ,r (id, gen_value, l) as ( select id ,substr(gen_value, instr(gen_value, ',') + 1) ,substr( trim(substr(gen_value,1, instr(gen_value, ',') - 1)) ,instr(trim(substr(gen_value,1, instr(gen_value, ',') - 1)),' ',-1) ) from data union all select id ,substr(gen_value, instr(gen_value, ',') + 1) ,substr( trim(substr(gen_value,1, instr(gen_value, ',') - 1)) ,instr(trim(substr(gen_value,1, instr(gen_value, ',') - 1)),' ',-1) ) from r where length(gen_value) > 0 ) select soundex(l) ,count(*) cnt ,max(l) keep ( dense_rank last order by length(l), l desc nulls first) v from r group by soundex(l) order by 1 SOUNDEX(L) CNT V A000 2 AAA A120 3 ABCE B210 3 BCEV B230 1 BCD M200 1 MNK
Maybe you are looking for
-
Hello I have a 2007 Macbook, it is not a Pro. I have been informed that the lion is compatible with this computer, but I'm stumped on how to update the latest software, this device is compatible with the witch is not el capitan (obviously). could som
-
Still 2 WT8-B-102 - loading and using a mouse at the same time
Hello I have a Tablet yet 2 WT8-B-102. Anyone know, please, what would happen if I tried to load / use on current electric at the same time that the use of an external mouse? I have an adapter that plugs into the micro-usb port and has two connectors
-
I can not download on my computer beak not enough space... I tried workarounds when I googled and it is not working thank you
-
Problems to import pictures from my Canon Powershot A580 - Windows Image Acquisition?
All the photos I import into Adobe transfer in a .tiff because of a TWAIN link images? What I have read that I need Windows Image acquisition. Can I download this? If yes where? I used to do this with this camera without problems until a recent vi
-
HP2000: Mo - a02 tpn-i106 laptop computer hp2000
backlight not lighting of the screen or flashing, screen has been replaced and same question remains, please let me know what I can do to fix