Show data as a percentage of column with a static table
HelloI have a problem of calculating one percent in a table. I have two columns in the criteria tab:
Departments and degree
I need an extra column % calc total departments for each Department. I know that I can do with PivotTable, create a new column and put: view-> data as per cent of-> column but I do with the static table.
Is possible to do?
Thank you!!!
Alex,
You can try the following example here:
http://www.biconsultinggroup.com/knowledgebase.asp?CategoryID=198&SubCategoryID=364
by using the sum (measure of the size attribute)
This should give you access total general in the report in a column, you can drift % of.
HTH, if it is correct, please mark answered / reward points, as you see fit to do!
Alastair
Tags: Business Intelligence
Similar Questions
-
selection of lines corresponding to two columns with two entry tables
I have a table with two columns int primary key tab1. id1 and id2.
Now I have two created two tables of figures: array1 {1, 2, 3,...} and {0, 1, 0,...} array2 Arrays have the same length.
I want to do a select:
Select * from tab1 where tab1.id1 = array1.column_value and tab1.id2 = array2.column_value;
If I want to receive 13 lines with this request, I had 169 because it tries to match all the different combinations in the tables.
If I do it with a loop for:
for i of array1
loop
Select * from tab1 where tab1.id1 = array1 (i) and tab1.id2 (i);
end
That should illustrate what I want to do, I just thought it would be faster if I could do it without a loop, do not use the pl/sql. Can it be done? If not, should I use a loop for with bulk collect somehow?SQL> with t as ( select 1 id1, 0 id2 from dual union all select 2, 0 from dual union all select 3, 0 from dual union all select 4, 1 from dual ) -- -- select id1, id2 from t, (select rownum rn1, a1.* from table (sys.odcinumberlist (1, 2, 3, 4)) a1) a1, --- array1 (select rownum rn2, a2.* from table (sys.odcinumberlist (0, 1, 0, 1)) a2) a2 --- array2 where (id1, id2) in ( (a1.column_value, a2.column_value)) and rn1 = rn2 / ID1 ID2 ---------- ---------- 1 0 3 0 4 1 3 rows selected.
-
How to show total pivot in value only and percentage only column
Hi all
I want to show the PivotTable by percentage of column only (no value), but the total in value only without display of percentage.
How to do this?
Thank you
LingHere it is 2 different approaches:
(1) is something like
Bike = $253 M = 20% = 27% = 53%Extract columns as
Product, region, dirty, dirty---> region is for values(East,West..), % and other sales is for Total as below
for the first sale exp: ((sales*1.0) /sum (sales by Product)) * 100.0--> column format and the percentage value
for the 2nd sale exp: sum (product sales)In the pivot table
Columns and product sales (2nd) online
Region to columns
% Sales to measures(2) you can go with Bike = 20% = 27% = 53% = $253 M
Use a cast as exp: cast (sum (product sales) as char)
If you are not agree with any of these just wait for our Guru David_T. You can get the best solution...
Published by: Srini VIEREN on 28 January 2013 23:50
-
Show data concatenated with another column labels
Dear all,
Want to show the data label concatenated with the value axis of legend or any other
http://obiee11ge.blogspot.com/2010/07/show-data-labels-concatenated.html
Concerning
MustafaHello Mustafa,
Maybe you can start with this: http://obiee101.blogspot.com/2008/01/obiee-xy-and-data-in-mouse-over-label.html
concerning
John
http://obiee101.blogspot.com -
Insert/update the column with the clob data type
Hi all
ORCL Version: 11g.
I have a table with the clob data type.
Test12
(col1 clob);
I'm trying to insert/update to update the column with more than 4000 characters.
But due to the limitation of tank 4000, I could not Insert/Update.
Need your help in resolving this issue.
THX
Rod.
The limit of 4000 characters is incorrect. That pertains only to the varchar2 data type. A clob can hold more than 4 G.
Here is an example that shows how to insert it, I found...
Otherwise, here is a way 'dirty' to do.
insert into your_table (COLA, COLB)
values
(PRIMARY_KEY, PART 1 OF DATA)
;
Update your_table
Define COLB = COLB | PART 2 OF BIG DATA
where COLA = PRIMARY_KEY;
Update your_table
Define COLB = COLB | PART 3 OF BIG DATA
where COLA = PRIMARY_KEY;
.. and so on...
I don't know that I personally recommend the second style... But he could do the job.
-
Hello
I have an emp_job_det with a, b, c columns table. Note that this TABLE ALREADY has DATA OF THESE COLUMNS
IAM now add a new column "D" with forced not null
Fistly I alter the table by adding the single column "D", if I do, the entire column would be created with alll of nulls for the column DEFAULT D
ALTER table emp_job_det Add number D; -do note not null CONSTRAINT is not added
Second... If I try to add the constraint not null, get an eoor as already conatained null values...
(GOLD)
In other words, if I put the query
ALTER table emp_job_det Add number D NOT NULL; -THROWS ERROR AS TABLE ALREADY CONTAINS DATA
So my question is how how can I add a new column with a constraint not null, table already has the data, without falling off the table
Please help me on this issue...
Add the column without constraint, then fill the column. Once all the rows in the table are given in the new column, and then add the constraint not null.
-
Columns with the same name but different data or precision length.
DB version: 10 gr 2
In a diagram, I need to find all of the columns with the same name but different or precision data length (if the column is of type number). I know I have to use the USER_TAB_COLS view for this. But I need to find a logic to compare the names of columns and its lengths.something like
select t1.table_name , t1.column_name , t1.data_type , t1.data_length , t2.table_name , t2.column_name , t2.data_type , t2.data_length from user_tab_columns t1 , user_tab_columns t2 where t1.table_name != t2.table_name and t1.column_name = t2.column_name and t1.data_type = t2.data_type and t1.data_length != t2.data_length
... could be a starting point.
-
I can add a column to an existing table with the data.
Hello
I'm working on
The Version of database: Oracle 9i
I can add a column to an existing table that already has data with below given command.
ALTER TABLE table_name
ADD the definition of the column_name column;
Kind regards
JohnAdd to that:
If your new column is NOT "null", you need the task in 3 steps:
1. Add the column without a NOT NULL constraint
2. the default value of the new column added.
3. Add the NOT NULL constraint in the new column.concerning
AJ -
show all columns with union all
Hi all
How can I view all (and not common) columns of the two tables when I use union all likeselect m_id, total, cat_id from scott.maintenance where prod_id = 1 union all select m_id, total, prod_id from scott.maintenance where prod_id = 4
m_Id, total, cat_id, prod_id
Thank you
JohnnyHi, Johnny,.
user9542267 wrote:
Hi allselect m_id, total, cat_id from scott.maintenance where prod_id = 1 union all select m_id, total, prod_id from scott.maintenance where prod_id = 4
How can I view all (and not common) columns of the two tables when I use union all like
m_Id, total, cat_id, prod_idThank you
JohnnyThere is no need to make a trade UNION for this:
SELECT * FROM scott.maintenance WHERE prod_id IN (1, 4) ;
If you really need to do a UNION and basic tables were the same or had the same number and types of columns, then you can use SELECT * in the two branches of the UNION:
SELECT * FROM scott.maintenance -- UNION ALL -- SELECT * FROM foo.maintenance ;
If the columns have different names in the two tables, the names of the first branch of the UNION will be used in the output.
In all cases, you can add literal NULL values to the SELECT one or more branches of the UNION clause:
SELECT ename AS name , hiredate , deptno FROM scott.emp -- UNION ALL -- SELECT dname AS name -- alias not necessary, but helpful , NULL AS hiredate -- alias not necessary, but helpful , deptno FROM scott.dept ;
Depending on your tables and your requirements of yor, you might be able to use SELECT * in a branch of the UNION.
Published by: Frank Kulash, February 15, 2011 12:29
-
Cannot create a clean column with links
Dear friends of the APEX,
I'm developing an interactive report and you want to have in it a clean column with links instead of the standard "pencil" - column.
I explain it by the example of https://apex.oracle.com/pls/apex/f?p=81683:1:
I want that "Deptno" column had links with the viewer just as single line "pencil" - column a.
My idea was to change the type of column "Deptno" of plain text to link.
But, unfortunately, when I did in the pictures Page and save the modified Page Builder type column to return to 'plain text '.
Anyone here know, what I did wrong?
Thank you very much!
LHOST
Franck wrote:
I'm developing an interactive report and you want to have in it a clean column with links instead of the standard "pencil" - column.
I explain it by the example of https://apex.oracle.com/pls/apex/f?p=81683:1:
I want that "Deptno" column had links with the viewer just as single line "pencil" - column a.
Why would you do?
My idea was to change the type of column "Deptno" of plain text to Link.
If unique lines are not identified using a PK column, add ROWID to the projection of the report query and set the Type of this column to hidden column.
Set the Type of the DEPTNO column on link, the link target #, #DEPTNO #and attributes of link to link text class = 'a-IRR-detail-row' data-line-id = "" #ROWID # "." Replace "ROWID" with the PK column name when unique lines are identified with a single column value. Save the changes.
But, unfortunately, when I did in the pictures Page and save the modified Page Builder type column to return to 'plain text '.
Anyone here know, what I did wrong?
You changed the type of column 'Link' but did not enter the other properties needed to operate it as a link.
-
Hello
I want to fill a column with numbers from 1 to the end of the table. I need to create a function for him?
THX in advance
2890953 wrote:
Hello
I want to fill a column with numbers from 1 to the end of the table. I need to create a function for this?
THX in advance
What of it?
SQL > create table mytable
(
number of N1
number of n2
)
Table created.
SQL > insert into mytable (n1)
Select the level of + 1000 - number + 1000
of the double
connect by level<=>=>
10 rows created.
SQL > update mytable
the value of n2 = rownum
10 lines to date.
SQL > select * from myTable
N1 N2
---------- ----------
1001 1
1002 2
1003 3
1004 4
5-1005
1006 6
1007 7
8 1008
1009 9
10 1010
10 selected lines.
Kind regards.
Alberto
-
Use the Quick Date year section in the column header
Version 11.1.1.7
I have a dashboard command prompt which invites for a date.
My analysis is filtered on this prompt.
My data looks like this:
Accounting_Date FY1_Data FY2_Data FY3_Data
31 AUGUST 2014 200 300 400
AUGUST 31, 2013 275 325 450
My requirement is to display the exercise as the heading of column (as opposed to FY1_Data, FY2_Data, FY3_Data).
FY1_Data is the year of the accounting Date - 2.
FY2_Data is the year of the Date of accounting order - 1
FY3_Data is the year of the accounting Date
So, for the first record in my table example, the column headers must be (2012, FY2013, FY2014)
For the second disc, the column headers must be (fiscal year 2011, 2012, FY2013).
To do this, I have tried the following to the first column only:
I put the column header to FY@{Year1}
Then I put my dashboard accounting cut-off Date prompt to fill a variable presentation (ActPrdDt).
Then I created another guest of 'Variable' dashboard with a year1 variable name.
In this prompt, I used SQL results as the default selection:
Select 'Date_Table '. "' Accounting_Date ' from 'MySubjectArea' where 'Date_Table '. "" Accounting_Date "= @{ActPrdDt}
The problem is that the full date is displayed in the column header (AFA 08/31/2014).
I tried to modify the sql statement in my second guest of dashboard for
Select TO_CHAR ("Date_Table". "Accounting_Date", "YYYY")-2 of... "
but the column header displays all values in the column, which is usually what it displays when there is an error in the sql statement.
Is it possible to manipulate the sql statement to get only the year of the accounting Date and subtract 1 or 2 him?
I changed the sql statement
Of
TO_CHAR ("Date_Table". "Accounting_Date", "YYYY")-2 "
TO
extract (year of "Date_Table". "Accounting_Date")-2 "
This solved my problem.
-
Change the Data Type of column on large partitioned Table Tablet
Hello
I was tasked to change a certain NUMBER of collar to a colonel VARCHAR2
It is usually an easy task, but I ran into several challenges due to the size of the table, the second major problem is the compression of the table.
To begin with, the Table and index are 4.4 to and hold around 11 lines billion. That the Table is compressed, not the index.
The first option was to add a new collar of VCHAR, update from the Col de NUM, file and then drop the colonel NUM
We ran this test in the Test environment and because discovered Compression Table that you can only mark the column is not used, and it can only be moved permanently from the Table if you unzip the whole Table and run «...» REMOVE the UNUSED COLUMNS'.
The second way is to create a separate Table copy with the values of the source of neck, then write to null to the source of neck, change data Type when its empty and then update the source again with the copy Table values.
The second option, that's what I'm testing, but I work with nearly 30 million lines by daily score, inserts take very long to fill.
How can I make faster inserts between the Source and the copy Table?
What other channels follow to accomplish the task above?
Concerning
Stephan
Nowhere in your proposed solution was necessary for you to understand why the data source changes, its as simple that to take what is ons the table (all the facts in the original post) and offering the best way on the basis of previous experience or oracle skills acquired over time.
If you spent so much time and thought to help with a solution that you did on WHY complain, you could have provided some feasible solutions already.
No thanks to your information irrelevant and unnecessary, I've implemented a solution already.
1 export the Source Table
2. create a 'replica Table' using the DDL source using a temporary table name
3. import all Partitions in the Table new
4. before the Cut-Over, synchronize the changes from the Source to the replica Table
5 rename the Source
5 rename the Table of replica for the Original Source Table name
6. slide the original Source Table
-
Ask the CLOB column (with XML content)
1. how to extract a particular xml tag value for a column with the CLOB data type.
Example:
< REQUEST_DETAIL >
PR < GROUP_TYPE > < / GROUP_TYPE >
< GroupName > ASSET MANAGEMENT TECHNICAL DATA < / GroupName >
< BUS_UNIT_ACRN > SCS-FCAT < / BUS_UNIT_ACRN >
< PROJ_MGR_ID > < / PROJ_MGR_ID >
< PROJ_MGR_NAME > Roland Roy < / PROJ_MGR_NAME >
< / REQUEST_DETAIL >
Select
XmlType (provable). Extract('/REQUEST_DETAIL/GROUP_TYPE/text()').getStringVal)
e t
/
example above works.
If I do not know the order of xml tag to ask how can I get the value.
(/ * * / / * * / REQUEST_DETAIL/GROUP_TYPE / * / *)
2 using the DBMS_LOB. SUBSTR takes longer to run and it never returns results and session will wait status for access to LOB_INDEX content (at the same time the CLOB column is used by the application).
Y at - it another option for faster results.
SELECT DBMS_LOB. SUBSTR (xml_blob, 4, DBMS_LOB.) INSTR (xml_blob, "< name >", 1, 1) + 6) name.
status,
CNT to COUNT (*)
OF LOG_TBL
WHEN TRUNC (IO_DATE) = TRUNC (SYSDATE)
GROUP OF DBMS_LOB. SUBSTR (xml_blob, 4, DBMS_LOB.) INSTR (xml_blob, "< name >", 1, 1) + 6),
status
Kind regards
Veera
Adiitional your reuirement to omit the public areas
2729533 wrote:
Your 1 returln sql any domain name (p099 and public - seems to search all nodes in an xml file). I only need 1 domain name (and omit the public areas)
- SELECT X.*
- T
- , xmltable ('(//*[DomainName!="PUBLIC"]/DomainName) [1] ')
- PASSAGE xmlparse (document t.XML_BLOB)
- THE DOMAIN VARCHAR2 COLUMNS (15) PATH '.'
- ) X
- where t.no = 317663815
-
Data selection in UDB where columns were named after the oracle data types
I have a couple of tables in UDB, I'm trying to reference on a HS db link.
The first table on the side of the UDB has a column named 'number' (bought the software - not something we did)...
Selecting this SEO column in this table and more specifically (i.e. Select number, col2, col3 etc) causes the error ORA-00936 (missing expression).
Select * works...
The second table also has a column called 'number', so the same problem above applies. [However, sql errors when I do a select * from ORA-00600: internal error code, arguments: [HO set: look long], [], [], [], [], [], [], [], [], [], []]
Our dba lean on it, - Oracle HS is new to us, so - I was hoping someone here might have an idea...
Using oracle 11.2.0.3.0.
When your DB2 database has column with reserved words in Oracle names, you must create a view of your DB2 side by specifying a different name for this column, and then use DG4ODBC to choose from the scoreboard instead of DB2.
Another approach which would require an additional programming is to use the DBMS_HS_PASSTHROUGH that allows to make statements that they are to the DB2 database without be analyzed in Oracle.
As for the ORA-600 error that you get this error is caused when your DB2 table contains certain character inspired columns that exceed the accuracy of the Oracle and are then mapped to the Oracle long data types. Normally in Oracle each table can have a long column. But to be able to select with the gateways of databases foreign this restriction has been slightly improved and more recent Oracle software can choose from the tables that contain more then a long.
So, could you please be more specific what program you use to select using the gateway fails with ORA-600 and could you please post your description of the table as it is stored in your DB2 database as seen using the gateway in SQL * more: desc (your DB2 table > @)
-Klaus
Maybe you are looking for
-
Mail does not appear to be updated on my iPhone.
The mail on my iPhone function does not work correctly. Mail arrives regularly on my iMac, but not my iPhone. When I go to the mail function, it remains in the mode of 'check' the e mail for a minute or two. Then it says "(mis à jour à 629 am) well w
-
Steam is safe to download on my laptop?
Steam is safe to download on my laptop for my grandson to use for games? Thank you.
-
Multifox fix for future versions of FireFox?
After upgrade FF (since version maybe 17 or 19 22 version I think, I'm a little late to complain about this), the Multifox feature has stopped working. Now when we try to open a new identity profile (activation of multiple accounts Yahoo or Gmail is
-
My yahoo homepage is shredded on Firefox, but not on Safari. How can I fix it?
I uninstalled Firefox and re-installed, but that has not worked. My Yahoo homepage looks like a puzzle. Images won't load does not correctly. Works fine on Safari, so I figure it's something in my Firefox settings.
-
Unable to turn on automatic updates
No matter what I do, I can not turn on automatic updates on my PC. Anyone there can help out me. Thank you...