Exclude a measure the total general dynamic level 'Lines' of a pivot table
Experts,Is it possible to exclude a measure the total general dynamic level 'Lines' for a pivot table?
Version - OBIEE 10g
Kind regards
LIBERATOR
No, I mean not the dropdown list above when you edit the formula in the column. It of there on 11g but don't remember off the top of my head if it is in the same place on 10g.
Paul
Tags: Business Intelligence
Similar Questions
-
Hello
I have an example of a query like this, can't expose the names of actual table I have security problems.
Select empno, count (empno) in the emp_table1 where certain conditions
Union of all the
Select empno, count (empno) in the emp_table2 where certain conditions
Union of all the
Select empno, count (empno) in the emp_table3 where certain conditions
Union of all the
Select empno, count (empno) in the emp_table4 where certain conditions
I get the result as below, no matter what.
Output
----------
EmpNo County
----------------------
Emp1 15
EMP2 12
Emp3 10
EMP4 6
Emp5 4
emp6 7
emp7 12
emp8 14
but finally, I should get a special register, displaying the total general as
emp_total 80
How can get this.please provide
Since I don't have access to your data, a simple way to show CUMULATIVE would be this.
WITH T1 (C1, C2) AS)
SELECT "emp1", 15 OF DOUBLE UNION ALL
SELECT "emp2", 12 OF DOUBLE UNION ALL
SELECT 'emp3', 10 OF DOUBLE UNION ALL
SELECT "emp4", 6 OF DOUBLE UNION ALL
SELECT "emp5", 4 OF DOUBLE UNION ALL
SELECT 'emp6', 7 OF DOUBLE UNION ALL
SELECT 'emp7', 12 OF DOUBLE UNION ALL
SELECT 'emp8', 14 FROM DUAL)
SELECT NVL(C1,'EMP_TOTAL'), SUM (C2)
FROM T1
ROLLUP GROUP (C1);
OUTPUT:
Emp1 15
EMP2 12
Emp3 10
EMP4 6
Emp5 4
emp6 7
emp7 12
emp8 14
EMP_TOTAL 80
-
The minimum/maximum application of the total general (Validation)
I have a form with several fields to which users (employees) to enter their work hours. The total general (a read only field) must be 40. I relied on FormClac to enter the SUM function.
I want to prevent users from sending the form if the total is less than or greater than 40, but I don't want to constantly make them an error message (while filling out the form) if the total is not 40. I want the error message to appear only if they try to submit the form and to prevent them from sending the form if the total is not 40.
I really don't know much about JavaScript so I would really appreciate if someone could send me an example.
Thank you
Yaniv
Use xfa.host.messageBox ().
See the help of designer at http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/js/html/wwhelp.htm
For the method messageBox, in particular, see http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/001720.html
Steve
-
How to view the total general to IR
Hyperion IR: 9.2
Good in my results to my query section, my table shows total general of my column in the middle (3 in total). Pretty easy.
However when I create the report and display the table, I want that the grand total of the column in the Middle, but it does not show the total general (dimension table) unless it's a fact table - that positions itself in the last column, not in the middle.
How can I go about it?
THX.Layout your facts and Dimensions of the table. By default the facts appear to the right even if the Dimensions are added after the fact.
Then, click your mouse in the data part of the fact, and it will highlight. Then click and drag the column to the position where you would like.
Hope that helps
Wayne
-
How can I find the total number of items in a dim multi table
How can I find the total number of items in a simple Sun table or multi?
For example, a table 2 x 3 has 6 elements, and a 2 x 3 x 4 to 24. How can I calculate this very easily - is there a single VI do that?
David
Use "table size" (palette table) followed by "multiply the elements of the array" (digital palette)
(Also works well for 3D arrays and higher)
-
Refresh the components within a specific line of an af:table programmatically
How do I refresh the components within a specific line of an af:table programmatically without refreshing the entire table? _
I have an af:table to display a view read-only object. There is a button change in the table by calling an af:popup, where the user can update the information and click on a submit button to commit its changes.
The action of this button property is a method in a holder in the summer where
-1: a stored procedure is called to update several tables (related to my read-only VO).
-2: the VO is re-interviewed (refreshQueryKeepingCurrentRow() VO.)
-3: updating of the whole table (AdfFacesContext.getCurrentInstance () .addPartialTarget (myTable))
Is it possible to programmatically refresh some components of the current row in the table without refreshing the entire table (point 3)?
I tried to play with the property "partialTrigger" to af: outputText (table: column: outputText), without success.
Thank you
NicolasOK, that's a very clear answer, thank you.
Now, first do a little optimization:
if(!StringUtils.isStringEmpty(results) && results.equals("TRUE")) // should be if ("TRUE".equals(results)) // since it's faster, simpler and requires one less dependency
For your use case, you can say you want to always refresh the line, then you could link the table in your backing bean, retrieve the selectedRowKeys and then set the key for the current line on the model in the collection before adding the partial target. So, something like:
Set
p.s. I checked the table rendering code to be sure and partial updating of the contents of the line must be possible without refreshing the entire table.
Kind regards
~ Simon
-
How to avoid the total general of the classic report when the column break is installed in the Apex
Hi all
I develop application using Oracle Apex 4.2.0.
I created the classic report Page.
That I have summarized a column by selecting the check box check sum for the column.
His shows the Grand Total.
Then I chose the columns to break to the first column.
His show the total groupwise and total as well as great as image below.
My requirement is
Need to hide total(Total:)) GroupWise or total general. I need to show any a total, not both.
How to do this?
Thank you
Su.GI
Su.GI wrote:
Hi, thanks for your response.
I use theme - productivity Application - issue 26
-Standard model
Report - report of Standart for classic report model.
The above CSS code where I want to use in the page or report or model region.
Specify a static region ID for the report area and put the following CSS rule in the CSS Inline property page:
#static-region-id .uReportStandard tr:last-child td { display: none; }
where
static-region-id
is the ID specified for the region. -
How to add the total general of PivotTable?
Hi experts
I have a PivotTable that has the following text:
-L' year as a Dimension
-Column: Number of orders
-Column: Value of the order
Can anyone advise on how to add a grand total of lines which will show:
-Total general for the number of orders
-Total general for the value of the order
Thank you very much
FranckModify the report
-> Click on symbol warning lines-> select after/before
-> Click on columns, the summation symbol-> select after/beforePls mark if this can help...
-
Using subqueries in Select with Rollup (or a way to get the total general)
I'm doing the following (simplified the query):
SELECT s.SYSTEM,
(SELECT COUNT (cp1.cid) of THE CFRS cp1, systems sp1, subsystems ssp1 where cp1.priority = 'P1' AND cp1.subsystem = ssp1.subsystem AND sp1.system = ssp1.system AND sp1.system = s.system) AS P1
Of THE c, s systems, subsystems ss CFRS
WHERE c.subsystem = ss.subsystem
AND s.system = ss.system
GROUP OF ROLLUP (s.SYSTEM)
But the result of the cumulative on the P1 column is always 0 (is not to summarize it)
How can I perform a rollup (or get a total) the result of the subquery?
Thank youWhat something like this:
SQL > WITH SYSTEMS AS 2 ( 3 SELECT 'A' AS SYSTEM FROM DUAL UNION ALL 4 SELECT 'B' AS SYSTEM FROM DUAL UNION ALL 5 SELECT 'C' AS SYSTEM FROM DUAL 6 ), 7 SUBSYSTEMS AS 8 ( 9 SELECT 'A' AS SYSTEM, '1' AS SUBSYSTEM FROM DUAL UNION ALL 10 SELECT 'A' AS SYSTEM, '2' AS SUBSYSTEM FROM DUAL UNION ALL 11 SELECT 'A' AS SYSTEM, '3' AS SUBSYSTEM FROM DUAL UNION ALL 12 SELECT 'B' AS SYSTEM, '4' AS SUBSYSTEM FROM DUAL UNION ALL 13 SELECT 'B' AS SYSTEM, '5' AS SUBSYSTEM FROM DUAL UNION ALL 14 SELECT 'B' AS SYSTEM, '6' AS SUBSYSTEM FROM DUAL UNION ALL 15 SELECT 'C' AS SYSTEM, '7' AS SUBSYSTEM FROM DUAL UNION ALL 16 SELECT 'C' AS SYSTEM, '8' AS SUBSYSTEM FROM DUAL UNION ALL 17 SELECT 'C' AS SYSTEM, '9' AS SUBSYSTEM FROM DUAL 18 ), 19 CFRS AS 20 ( 21 SELECT 10 AS CID, '1' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL 22 SELECT 11 AS CID, '1' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL 23 SELECT 12 AS CID, '1' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL 24 SELECT 13 AS CID, '2' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL 25 SELECT 14 AS CID, '2' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL 26 SELECT 15 AS CID, '2' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL 27 SELECT 16 AS CID, '3' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL 28 SELECT 17 AS CID, '3' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL 29 SELECT 18 AS CID, '4' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL 30 SELECT 19 AS CID, '5' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL 31 SELECT 20 AS CID, '5' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL 32 SELECT 21 AS CID, '6' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL 33 SELECT 31 AS CID, '7' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL 34 SELECT 41 AS CID, '8' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL 35 SELECT 51 AS CID, '9' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL 36 SELECT 61 AS CID, '9' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL 37 ) 38 SELECT DISTINCT SYSTEMS.SYSTEM 39 , CFRS.PRIORITY 40 , count(*) OVER (PARTITION BY SYSTEMS.SYSTEM, CFRS.PRIORITY) AS PER_SYSTEM_PRIORITY 41 , count(*) OVER () AS ALL_SYSTEMS 42 FROM SYSTEMS 43 JOIN SUBSYSTEMS ON SYSTEMS.SYSTEM = SUBSYSTEMS.SYSTEM 44 JOIN CFRS ON SUBSYSTEMS.SUBSYSTEM = CFRS.SUBSYSTEM 45 ORDER BY SYSTEMS.SYSTEM, CFRS.PRIORITY 46 / SYSTEM PRIORITY PER_SYSTEM_PRIORITY ALL_SYSTEMS ---------- ---------- ------------------- ----------- A HIGH 4 16 A LOW 2 16 A MED 2 16 B HIGH 2 16 B LOW 1 16 B MED 1 16 C HIGH 1 16 C LOW 1 16 C MED 2 16
-
Hi, expert,
We have a class like this structure to store a table like structure in the persistent store:
class {} table
Vector lines; vector line, each line is another vector for the columns.
PrimaryKeyMaps Hashtable;
String tableName;
}
We know that we should use ObjectGroup to save persisent object handle. Right now, I use the group for each line vector object (all columns in a row are grouped). If each line would consume only a handful of persistent object. I guess I should group the primaryKeyMaps as well. However I wonder if I need to group them at the level of the entire table or not, because if there are 50 rows to the table, I would use 50 handler object persistent for all these lines. Managers how persisetent demand would be reasonably use in general? What is a good balance between performance and keeping the persistent object handles?
I use a very similar structure to store Tables in PersistentStore, and I grouped by row (I do not use Group objects, I essentially to serialize the row)... But that's all. And I have a large number of lines in a number of tables, certainly more than 10,000 usually. Works very well.
Persistent used to be a big problem, but I think you'll find that it isn't now, so unless you are targeting devices used (pre OS 4.6), or you have more than 10 s of thousands of lines, then I think that the structure, you are currently to assistance is therefore probably good enough. And if you become big, you should probably move the data to SQLite.
I'm a little concerned by the hash table you mind, I have not this and it is more than double the number of persistent Handles because you have an object for the key and the value. have you looked to optimize this, perhaps using an intHashTable to kill using object?
But if you are looking for where you will not store 10s of thousands and thousands of lines, I think what you do is very well.
-
Totals of line in a pivot table querry
Hi all
I was wondering if any of you would be able to help me, I have the query that is used for analytical purposes on one of our databases, but what I would now below is an additional column to add which will add up all the values in each row (as a total) for each line that the query returns. Actually t its possibe?
Thank you very much
Mark
SELECT derived_table_name,
SUM (decode (field_type_id, 0, cnt, NULL)) not_set,.
SUM (decode (field_type_id, 1, cnt, NULL)) application_setting,.
SUM (decode (field_type_id, 2, NTC, NULL)) update_parameter,.
SUM (decode (field_type_id, 3, cnt, NULL)) database_setting,.
SUM (decode (field_type_id, 4, cnt, NULL)) application_options,.
SUM (decode (field_type_id, 5, cnt, NULL)) pk_or_fk,.
SUM (decode (field_type_id, 6, cnt, NULL)) attribute.
SUM (decode (field_type_id, 7, cnt, NULL)) description_or_names,.
SUM (decode (field_type_id, 8, cnt, NULL)) script_related,.
SUM (decode (field_type_id, 9, cnt, NULL)) audit_table_field,.
SUM (decode (field_type_id, 10, cnt, NULL)) client_field,.
SUM (decode (field_type_id, 11, cnt, NULL)) pia_staging_data,.
SUM (decode (field_type_id, 12, cnt, NULL)) report_related,.
SUM (decode (pia_mandatory, 'Y', cnt, NULL)) pia_mandatory,.
SUM (decode (obsolete, 'Y', cnt, NULL)) obsolete.
SUM (decode (duplicated, 'Y', cnt, NULL)) duplicated
FROM (SELECT f.derived_table_name,
f.field_type_id,
f.pia_mandatory,
f.obsolete,
f.Duplicated,
Count (*) NTC
OF nsd_field f
Derived_table_name GROUP,
f.field_type_id,
f.pia_mandatory,
f.obsolete,
f.Duplicated)
GROUP BY derived_table_nameIs this what you are looking for?
SELECT derived_table_name, SUM(decode(field_type_id, 0, cnt, NULL)) not_set, SUM(decode(field_type_id, 1, cnt, NULL)) application_setting, SUM(decode(field_type_id, 2, cnt, NULL)) update_parameter, SUM(decode(field_type_id, 3, cnt, NULL)) database_setting, SUM(decode(field_type_id, 4, cnt, NULL)) application_options, SUM(decode(field_type_id, 5, cnt, NULL)) pk_or_fk, SUM(decode(field_type_id, 6, cnt, NULL)) attribute, SUM(decode(field_type_id, 7, cnt, NULL)) description_or_names, SUM(decode(field_type_id, 8, cnt, NULL)) script_related, SUM(decode(field_type_id, 9, cnt, NULL)) audit_table_field, SUM(decode(field_type_id, 10, cnt, NULL)) client_field, SUM(decode(field_type_id, 11, cnt, NULL)) pia_staging_data, SUM(decode(field_type_id, 12, cnt, NULL)) report_related, SUM(decode(pia_mandatory, 'Y', cnt, NULL)) pia_mandatory, SUM(decode(obsolete, 'Y', cnt, NULL)) obsolete, SUM(decode(duplicated, 'Y', cnt, NULL)) duplicated, SUM(decode(field_type_id, 0, cnt, 0)) + SUM(decode(field_type_id, 1, cnt, 0)) + SUM(decode(field_type_id, 2, cnt, 0)) + SUM(decode(field_type_id, 3, cnt, 0)) + SUM(decode(field_type_id, 4, cnt, 0)) + SUM(decode(field_type_id, 5, cnt, 0)) + SUM(decode(field_type_id, 6, cnt, 0)) + SUM(decode(field_type_id, 7, cnt, 0)) + SUM(decode(field_type_id, 8, cnt, 0)) + SUM(decode(field_type_id, 9, cnt, 0)) + SUM(decode(field_type_id, 10, cnt, 0)) + SUM(decode(field_type_id, 11, cnt, 0)) + SUM(decode(field_type_id, 12, cnt, 0)) + SUM(decode(pia_mandatory, 'Y', cnt, 0)) + SUM(decode(obsolete, 'Y', cnt, 0)) + SUM(decode(duplicated, 'Y', cnt, 0)) sum_total FROM (SELECT f.derived_table_name, f.field_type_id, f.pia_mandatory, f.obsolete, f.duplicated, COUNT(*) cnt FROM nsd_field f GROUP BY derived_table_name, f.field_type_id, f.pia_mandatory, f.obsolete, f.duplicated) GROUP BY derived_table_name
Edited by: hartmutm the 30.09.2010 03:05
-
How to change the font of a particular line color in <; af:table >;
I have a < af:table > bounded a ViewObject ReadOnly and this display object is a collection of a sql query. Now, when this table is rendered, I want specific attributes to change the color of police based on some logic.
For example. If my af:table is a set of results that has Attributest as... EmployeeName. BalanceLeave. So I want the BalanceLeave value shoud displayed in red if the value of the attribute balance leave is greater than 20.
Please help me on this.To do this, you use the attribute styleClass property and an EL related to a managed bean to return the style you want.
Something like this to change the colorpublic class ColorSwitchBean { public ColorSwitchBean() { super(); } String mStyleClass = null; String mColorSyle = null; public String getStyleClass() { FacesContext fc = FacesContext.getCurrentInstance(); ELContext elc = fc.getELContext(); ExpressionFactory elf = fc.getApplication().getExpressionFactory(); String sval = (String)elf.createValueExpression(elc, "#{row.City}", Object.class).getValue(elc); if (sval.startsWith("S")) mStyleClass = "red_background"; else if (sval.startsWith("M")) mStyleClass = "green_background"; else mStyleClass=""; return mStyleClass; } public void setStyleClass(String aStyleClass) { mStyleClass = aStyleClass; } public void setColorSyle(String mColorSyle) { this.mColorSyle = mColorSyle; } public String getColorSyle() { FacesContext fc = FacesContext.getCurrentInstance(); ELContext elc = fc.getELContext(); ExpressionFactory elf = fc.getApplication().getExpressionFactory(); String sval = (String)elf.createValueExpression(elc, "#{row.City}", Object.class).getValue(elc); mColorSyle = ""; if (sval.startsWith("S")) { mColorSyle = "background-color:Red"; } else if (sval.startsWith("M")) { mColorSyle = "background-color:Green"; } return mColorSyle; } }
and cela inside the table:
-
Timo
-
In total, total general at pivot
Hello guys,.
I have a situation...
I use Pivot for a report (the reason being... I need data per month in sections...) ...
I need total for each article, so I used the button lines for a total sum of each section (once again the reason to be... If I had used the sum of Sections... it displays another article that "All sections" which is nothing but all clubbed entries in a single table... which is not desirable in my case)...
So I almost what I want... the only thing I would need is the total of all the totals at the bottom...
Can someone help me please... I tried many ways... but could not...Hello
As I've described above the Grand Total downstairs is a separate joint. In the report that I had joined earlier in the pivot at the bottom, I've included just the brand of column and the measurement in the pivot column. Here, create a calculated item in the column of the brand, put the formula as sum (*) and the name of the element calculated as the Total general. Then, select the option "Hide details" column of the brand. Also make the label hidden measure.
Thank you
-
Total general (calculation) seems to be "1-step behind" Sub totals.
Order form calculates OK from left to right (ie. quantity x price); Subtotals appear OK in the Grand Total, AND Grand Total does NOT save the newest item (eg. I come home from 4 items, but the total general records only the first 3) I may need to send a form of enlightenment. Thoughts?
It's a problem of calculation of field command. You can set it in form editing mode, via
The value more - field calculation order.
-
Total amount, but not the Total number of ranking
Morning all,
I'm trying to rank user name based on the total sum of the waived amount but I want to avoid the Total general ranking at the bottom, more I don't want their order of ranking, I want the order remains the same, as it is currently.
SELECT DECODE(GROUPING(USERNAME),1,'TOTAL',0,UPPER(USERNAME)) as "USERNAME", SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'JAN' THEN AMOUNT_WAIVED ELSE 0 END) AS JAN, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'FEB' THEN AMOUNT_WAIVED ELSE 0 END) AS FEB, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'MAR' THEN AMOUNT_WAIVED ELSE 0 END) AS MAR, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'APR' THEN AMOUNT_WAIVED ELSE 0 END) AS APR, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'MAY' THEN AMOUNT_WAIVED ELSE 0 END) AS MAY, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'JUN' THEN AMOUNT_WAIVED ELSE 0 END) AS JUN, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'JUL' THEN AMOUNT_WAIVED ELSE 0 END) AS JUL, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'AUG' THEN AMOUNT_WAIVED ELSE 0 END) AS AUG, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'SEP' THEN AMOUNT_WAIVED ELSE 0 END) AS SEP, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'OCT' THEN AMOUNT_WAIVED ELSE 0 END) AS OCT, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'NOV' THEN AMOUNT_WAIVED ELSE 0 END) AS NOV, SUM(CASE WHEN TO_CHAR(DATE_PROCESSED,'MON') = 'DEC' THEN AMOUNT_WAIVED ELSE 0 END) AS DEC, SUM(AMOUNT_WAIVED) AS "TOTAL" FROM A3_FACT_AMS_WAIVED_ARREARS WHERE TO_CHAR(DATE_PROCESSED,'YYYY')='2012' GROUP BY ROLLUP (USERNAME)
USERNAME JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC TOTAL AARKOVITS 0 6.5 39 0 39 0 32.5 6.5 6.5 0 0 0 130 ABINGE 52 0 0 19.5 19.5 39 78 234 0 0 0 0 442 ACOUGHLIN 0 0 9.75 6.5 39 21.68 0 26 6.5 0 0 0 109.43 BFOSTER 39 0 26 0 0 0 19.5 6.5 0 0 0 0 91 BWOOLLARD 0 0 0 0 6.5 0 0 0 0 0 0 0 6.5 CCHAPMAN 0 0 0 0 0 260 13 19.5 39 0 0 0 331.5 CLAW 0 13 0 0 0 0 0 0 0 0 0 0 13 CROBSON 0 32.5 0 0 0 0 0 0 0 0 0 0 32.5 EATMORE 71.5 13 26 39 0 0 13 0 0 0 0 0 162.5 EMORRIS 0 0 0 0 0 13 97.5 13 0 0 0 0 123.5 EPENNINGTON 0 0 0 0 0 0 13 13 0 0 0 0 26 EROLLASON 0 0 19.5 52 0 0 0 0 0 0 0 0 71.5 EWATKINSON 0 19.5 13 32.5 0 0 0 0 0 0 0 0 65 FSEYMOUR 32.5 100 19.5 0 61.4 0 0 0 0 0 0 0 213.4 GTYSON 0 32.5 0 91.75 6.5 0 0 149.5 0 0 0 0 280.25 HMACKENZIE 0 0 0 39 0 0 0 19.5 0 0 0 0 58.5 HTILFORD 0 0 0 19.5 13 19.5 0 71.5 0 0 0 0 123.5 IRYDER 0 0 0 0 0 0 0 50.87 74.64 0 0 0 125.51 JASHTON 0 6.5 13 39 0 0 46.5 13 0 0 0 0 118 JCOOPER 39.1 97.5 40.5 147.78 26 0 6.5 26 0 0 0 0 383.38 JCOUGHLIN 0 0 13 0 0 0 13 0 0 0 0 0 26 JHUDSON 0 0 58.5 0 0 0 0 0 0 0 0 0 58.5 JLEARMONTH 0 45.5 73 32.5 78 45.5 0 0 0 0 0 0 274.5 JPARKER 0 0 6.5 39 6.5 0 0 0 0 0 0 0 52 JPOULTER 0 0 0 0 0 58.5 0 0 0 0 0 0 58.5 JRUTHERFORD 0 0 0 0 0 0 26 0 0 0 0 0 26 JWILSON 0 0 13 26 0 0 6.5 0 0 0 0 0 45.5 KCLEMISHAW 0 0 0 6.5 6.5 0 0 0 0 0 0 0 13 KCOOK 0 0 0 13 0 0 13 0 0 0 0 0 26 KSMITH 0 0 0 0 0 0 0 6.5 0 0 0 0 6.5 KSYKES 0 0 13 0 0 0 0 0 13 0 0 0 26 LMUSGROVE 0 0 0 0 0 0 40.5 0 0 0 0 0 40.5 LPRINGLE 0 0 6.5 0 0 6.5 0 26 0 0 0 0 39 LSANFORD-KARLSSON 0 0 0 19.5 0 45.5 6.5 0 0 0 0 0 71.5 LUNWIN 0 0 0 0 0 39 0 6.5 0 0 0 0 45.5 MBELL 0 0 0 0 0 6.5 0 0 0 0 0 0 6.5 MBELLERBY 0 6.5 0 1.43 0 0 0 0 0 0 0 0 7.93 MFOUNTAIN 56.5 31.5 2.46 1.25 149.5 0 0 0 0 0 0 0 241.21 MJONES 0 0 0 123.5 0 0 0 0 0 0 0 0 123.5 MWILSON 0 0 0 0 13 0 0 0 0 0 0 0 13 NDEIGHTON1 0 78.18 78.08 0 0 78 143 78 0 0 0 0 455.26 NLDEIGHTON 0 0 0 0 0 0 0 21 0 0 0 0 21 NLIMBERT 117 45.5 0 0 0 0 0 130 0 0 0 0 292.5 OFRANKSPEDRICK 0 0 0 0 32.5 0 0 0 0 0 0 0 32.5 PDUFFY 0 130 149.5 162.5 0 227.5 240.5 175.5 26 0 0 0 1111.5 RBELL 0 26 26 13 0 26 39 0 0 0 0 0 130 RBIRCH 0 0 0 13 208 0 0 0 0 0 0 0 221 RGLYNN 0 0 13 0 6.5 0 13 19.5 0 0 0 0 52 RSANDERS 0 18.42 19.5 0 6.5 27.5 0 45.5 0 0 0 0 117.42 RTHOMPSON 84.17 108.06 152.5 41.17 84.5 51.58 54.16 63.94 0 0 0 0 640.08 SANDREWS 19.5 0 0 0 26 39 0 0 0 0 0 0 84.5 SDEMAINE 0 0 26 0 0 0 0 0 0 0 0 0 26 SDOWSON 0 6.5 0 0 6.5 0 26.06 0 0 0 0 0 39.06 SHARRIS 0 6.5 0 0 0 0 0 0 0 0 0 0 6.5 SMARSHALL 39 0 0 0 0 0 6.5 0 0 0 0 0 45.5 SSIMPSON 0 0 0 0 0 19.5 0 0 0 0 0 0 19.5 STEER 0 13 19.5 13 13 19.5 0 0 0 0 0 0 78 STOMLINSON 0 0 45.5 43.5 0 39 13 0 30.5 0 0 0 171.5 STYERS 0 0 0 0 0 0 0 6.5 0 0 0 0 6.5 TSOLLITT 0 84.5 12.5 19.5 39 0 78 52 0 0 0 0 285.5 WTASSELLI 0 0 65 0 0 0 39 91 0 0 0 0 195 ZDUTOIT 0 13 0 0 26 1.5 19.5 0 0 0 0 0 60 TOTAL 550.27 934.16 999.29 1054.88 912.9 1083.76 1096.72 1370.81 196.14 0 0 0 8198.93
Here's a way to do it:
SQL> select decode(grouping(e.job),1,'Total',e.job) as job 2 , sum(case when e.deptno < 20 then e.sal else 0 end) as col1 3 , sum(case when e.deptno = 20 then e.sal else 0 end) as col2 4 , sum(case when e.deptno > 20 then e.sal else 0 end) as col3 5 , sum(e.sal) as total 6 , decode( 7 grouping(e.job),0, 8 rank() over ( 9 order by 10 decode(grouping(e.job),0,sum(e.sal)) desc nulls last 11 ) 12 ) as rnk 13 from scott.emp e 14 group by rollup(e.job) 15 order by grouping(e.job) 16 , e.job 17 / JOB COL1 COL2 COL3 TOTAL RNK --------- ---------- ---------- ---------- ---------- ---------- ANALYST 0 6000 0 6000 2 CLERK 1300 1900 950 4150 5 MANAGER 2450 2975 2850 8275 1 PRESIDENT 5000 0 0 5000 4 SALESMAN 0 0 5600 5600 3 Total 8750 10875 9400 29025
Example using SCOTT. As I don't have your table, but you should be able to use the technique in your own case ;-) of EMP table
PS:
Your own example does not include an ORDER BY clause. A GROUP BY clause does not guarantee it will be ranked in the order of the columns in the GROUP BY - you can only be sure of the order if you have an ORDER BY. You could review your other code for the GROUP BY without ORDER BY case ;-)
Maybe you are looking for
-
A model of Mac Book 4.1 can be formatted with OSX 10.5.8?
A model of Mac Book 4.1 can be formatted with OSX 10.5.8?
-
awesome bar does not display existing addresses
Firefox itself upgrade just esr 38.2.0, and when I type in the awesome bar, it brings not existing more addresses. For example. I used to type s in the bar, and he would show slashdot.org, as it was the most common s that I visited. Now, it's just co
-
How can I change my search engine the default ff HOME PAGE of google for duckduckgo?
I tried to go to about: config, went to browser.search.defaultenginename. - entered duckduckgo - and ff opens HOWEVER with google. I don't want to google. To all.
-
Pavilion m9400t CTO: connection cable of the power supply to a Pavilion m9400t CTO
I installed a replacement PSU which has more cables and a few different - no problem on the identification and plug 20 + 4, 4 + 4 on the MB. Also, no problem connecting to the SATA cables for drives (HARD drive and two optical drives). There is a P
-
17 - f037cl: laptop don't care not what was advertised
I bought a HP laptop, model # 17 - f037cl who was said to have a processor 2.4 ghz in it. When I got home and checked, he appeared as a 2.0 ghz processor. Why the difference?