How to calculate the sum of the values of some columns of a table
hi
i want to get in the column averages just the average of the values of some columns not all the columns of the table.what i have to change exactly in this block diagram.even if the size of the table is 25,i want the division to be the number of values in each column(= number of rows)
just like that:
Solved!
Go to Solution.
Attachments:
operations on some columns.vi 10 KB
i did exactely what u told me, i think i missed something because i don't get the average value of the rows i want
Attachments:
average.vi 11 KB
Similar Messages
-
How to display the value of a column in a chart at the top of each column
How to display the value of each column in a chart at the top of each column?
Like this?
Done using chart Inspector.
For details, see Chapter 7, Creating Charts from Numerical Data in the Numbers '09 User Guide. The guide may be downloaded via the Help menu in Numbers.
Regards,
Barry -
How to fix the value of first column in the JTable in java swing for every
Hi ,
I have a swing page that have table panel in which there is a table of size 7x4 now when I click on the perticulat row then that row data will displayin the table like that the selected row become the second column in the new table and the fist column of this table will remain constant for all the entry but the second column update according to the roe which is selected .How it is possible .
Thanks in Advace,
anuOne thing you can do is to prevent the user from editing that column and programatically supply the values of that column yourself.
JTable table = new JTable() {
public boolean isCellEditable(int row, int col) {
if(col == 0) {
return false;
return super.isCellEditable(row, col);
};This allows you to prevent the user from editing the column information so you can supply some sort of a default value for the column always
ICE -
How to load the value in target column?
Hi
Source: Oracle
Target: Oracle
ODI: 11g
I have an interface which loads the data from source table to target. Some of the columns in the target tables are automatically mapped with source table. Some of the column remain un-mapped. Those who remain un-mapped, I want to load the values in that column by executing an query. So can anybody tell me where I should mention that query whose result would become the value of the specific column.
-Thanks,
ShrinivasYou can put the query (or subquery) into the mapping field.
You can also call a function in the mapping field which may be easier in your case. -
Hi Team,
Am using BULK INSERT Format file option to load data into table from .txt file here am facing an issue i.e ibased on input file i need to insert default values to some columns of table so we can not declare it on table level, Can we give default values in
format file ? if we can give how it is ? or Any alternate possibilities to this scenario instead of BULK INSERT ?
Thanks,
SudhakarThanks for your response, here i don't have any rights to change table structure the table is created by different team, my work is to load data from file to table. Is there any chance to supply default values by*XML* format file instead of *.fmt* file
please let me know the possibility.
Again, no. If you want to supply default values that are not present in DEFAULT constraints in the table definition, you will need to write your own code. There are plentyfull of options, and I have mentioned some already.
Here are some more:
* Table-valued parameters, see here for examples:
http://www.sommarskog.se/arrays-in-sql-2008.html
* Use BULK INSERT to load data to a staging table, and then apply the default values when you copy from staging to target.
Erland Sommarskog, SQL Server MVP, [email protected] -
Hi Experts,
I have doubt, i have an internal table now i want to calculate the total for every group. How to do that?
value type
5,439.01 ; ZMP0
509.60 ; ZMP0
4,749.26 ; ZMP0
9,053.95- ZPNL
732.70- ZPNL
66.30- ZPNL
18.10- ZS03
63.90 ; ZS03
According to the type i need a total for ZMPO, ZPNL, ZSO3 separately.
how to do that?
5,439.01 ; ZMP0
509.60 ; ZMP0
4,749.26 ; ZMP0
ZMPO total =
9,053.95- ZPNL
732.70- ZPNL
66.30- ZPNL
ZPNL total =
18.10- ZS03
63.90 ; ZS03
ZSO3 total =
Like that i need, can any one help this?
Regards,
MohanaHello,
Use the COLLECT.
DATA:
wa LIKE LINE OF itab,
itab_sum LIKE itab.
SORT itab BY key.
LOOP AT itab INTO wa.
COLLECT wa INTO itab_sum.
ENDLOOP.
The itab_sum has the same structure like the itab where is the data to me summarized, and the wa has the line structure of the itab.
Regards. -
How to calculate the percentage of free space for a table in Oracle
okay, I am a little confused here. I have been searching the web and looking at a lot of documents. What I basically want to find out is this, how do I calculate the difference between the number of bytes a table is using and the total bytes allocated to a table space (going that way to get percent free for a particular table). So I need a byte count of a table and total table space and the percentage difference. I have been looking at the DBA_TABLES DBA_TABLESPACES and DBA_SEGMENTS views. I have tried to calculated the space as num_rows * avg_row_len (if I am wrong, let me know). I have been trying to compare that calculation to the number in DBA_TABLESPACES and DBA_SEGMENTS. I am just looking for the total space allocated to the table space that the table sits in (seem logical right now) to make the percentage value work. Thus I want to be able to track the table as it grows as compated to the table space it sits in to see a value as it changes over time (days, weeks, etc.) each time I run this script I am working on.
Can someone get me straight and help me to find out if I am looking in the right places. Any advice would help.
EdwardYou can use a little modified version of dbms_space from Tom, show_space. Have a look,
SQL> create table test222 as select * from all_objects;
Table created.
SQL> delete from test22 where rownum<=100;
delete from test22 where rownum<=100
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> delete from test222 where rownum<=100;
100 rows deleted.
SQL> analyze table test222 compute statistics;
Table analyzed.
SQL> create or replace procedure show_space
2 ( p_segname in varchar2,
3 p_owner in varchar2 default user,
4 p_type in varchar2 default 'TABLE',
5 p_partition in varchar2 default NULL )
6 -- this procedure uses authid current user so it can query DBA_*
7 -- views using privileges from a ROLE and so it can be installed
8 -- once per database, instead of once per user that wanted to use it
9 authid current_user
10 as
11 l_free_blks number;
12 l_total_blocks number;
13 l_total_bytes number;
14 l_unused_blocks number;
15 l_unused_bytes number;
16 l_LastUsedExtFileId number;
17 l_LastUsedExtBlockId number;
18 l_LAST_USED_BLOCK number;
19 l_segment_space_mgmt varchar2(255);
20 l_unformatted_blocks number;
21 l_unformatted_bytes number;
22 l_fs1_blocks number; l_fs1_bytes number;
23 l_fs2_blocks number; l_fs2_bytes number;
24 l_fs3_blocks number; l_fs3_bytes number;
25 l_fs4_blocks number; l_fs4_bytes number;
26 l_full_blocks number; l_full_bytes number;
27
28 -- inline procedure to print out numbers nicely formatted
29 -- with a simple label
30 procedure p( p_label in varchar2, p_num in number )
31 is
32 begin
33 dbms_output.put_line( rpad(p_label,40,'.') ||
34 to_char(p_num,'999,999,999,999') );
35 end;
36 begin
37 -- this query is executed dynamically in order to allow this procedure
38 -- to be created by a user who has access to DBA_SEGMENTS/TABLESPACES
39 -- via a role as is customary.
40 -- NOTE: at runtime, the invoker MUST have access to these two
41 -- views!
42 -- this query determines if the object is a ASSM object or not
43 begin
44 execute immediate
45 'select ts.segment_space_management
46 from dba_segments seg, dba_tablespaces ts
47 where seg.segment_name = :p_segname
48 and (:p_partition is null or
49 seg.partition_name = :p_partition)
50 and seg.owner = :p_owner
51 and seg.tablespace_name = ts.tablespace_name'
52 into l_segment_space_mgmt
53 using p_segname, p_partition, p_partition, p_owner;
54 exception
55 when too_many_rows then
56 dbms_output.put_line
57 ( 'This must be a partitioned table, use p_partition => ');
58 return;
59 end;
60
61
62 -- if the object is in an ASSM tablespace, we must use this API
63 -- call to get space information, else we use the FREE_BLOCKS
64 -- API for the user managed segments
65 if l_segment_space_mgmt = 'AUTO'
66 then
67 dbms_space.space_usage
68 ( p_owner, p_segname, p_type, l_unformatted_blocks,
69 l_unformatted_bytes, l_fs1_blocks, l_fs1_bytes,
70 l_fs2_blocks, l_fs2_bytes, l_fs3_blocks, l_fs3_bytes,
71 l_fs4_blocks, l_fs4_bytes, l_full_blocks, l_full_bytes, p_partition);
72
73 p( 'Unformatted Blocks ', l_unformatted_blocks );
74 p( 'FS1 Blocks (0-25) ', l_fs1_blocks );
75 p( 'FS2 Blocks (25-50) ', l_fs2_blocks );
76 p( 'FS3 Blocks (50-75) ', l_fs3_blocks );
77 p( 'FS4 Blocks (75-100)', l_fs4_blocks );
78 p( 'Full Blocks ', l_full_blocks );
79 else
80 dbms_space.free_blocks(
81 segment_owner => p_owner,
82 segment_name => p_segname,
83 segment_type => p_type,
84 freelist_group_id => 0,
85 free_blks => l_free_blks);
86
87 p( 'Free Blocks', l_free_blks );
88 end if;
89
90 -- and then the unused space API call to get the rest of the
91 -- information
92 dbms_space.unused_space
93 ( segment_owner => p_owner,
94 segment_name => p_segname,
95 segment_type => p_type,
96 partition_name => p_partition,
97 total_blocks => l_total_blocks,
98 total_bytes => l_total_bytes,
99 unused_blocks => l_unused_blocks,
100 unused_bytes => l_unused_bytes,
101 LAST_USED_EXTENT_FILE_ID => l_LastUsedExtFileId,
102 LAST_USED_EXTENT_BLOCK_ID => l_LastUsedExtBlockId,
103 LAST_USED_BLOCK => l_LAST_USED_BLOCK );
104
105 p( 'Total Blocks', l_total_blocks );
106 p( 'Total Bytes', l_total_bytes );
107 p( 'Total MBytes', trunc(l_total_bytes/1024/1024) );
108 p( 'Unused Blocks', l_unused_blocks );
109 p( 'Unused Bytes', l_unused_bytes );
110 p( 'Last Used Ext FileId', l_LastUsedExtFileId );
111 p( 'Last Used Ext BlockId', l_LastUsedExtBlockId );
112 p( 'Last Used Block', l_LAST_USED_BLOCK );
113 end;
114
115 /
Procedure created.
SQL> desc show_space
PROCEDURE show_space
Argument Name Type In/Out Default?
P_SEGNAME VARCHAR2 IN
P_OWNER VARCHAR2 IN DEFAULT
P_TYPE VARCHAR2 IN DEFAULT
P_PARTITION VARCHAR2 IN DEFAULT
SQL> set serveroutput on
SQL> exec show_space('TEST222','SCOTT');
BEGIN show_space('TEST222','SCOTT'); END;
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "SCOTT.SHOW_SPACE", line 44
ORA-06512: at line 1
SQL> conn / as sysdba
Connected.
SQL> grant sysdba to scott;
Grant succeeded.
SQL> conn scott/tiger as sysdba
Connected.
SQL> exec show_space('TEST222','SCOTT');
BEGIN show_space('TEST222','SCOTT'); END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'SHOW_SPACE' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL> exec scott.show_space('TEST222','SCOTT');
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> exec scott.show_space('TEST222','SCOTT');
Unformatted Blocks ..................... 0
FS1 Blocks (0-25) ..................... 0
FS2 Blocks (25-50) ..................... 1
FS3 Blocks (50-75) ..................... 0
FS4 Blocks (75-100)..................... 1
Full Blocks ..................... 807
Total Blocks............................ 896
Total Bytes............................. 7,340,032
Total MBytes............................ 7
Unused Blocks........................... 65
Unused Bytes............................ 532,480
Last Used Ext FileId.................... 4
Last Used Ext BlockId................... 1,289
Last Used Block......................... 63
PL/SQL procedure successfully completed.
SQL>http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5350053031470
I use this to find the space allocations.
Just read your post again,this is not going to show you the percentage of the free/used space. This is going to be the number of blocks which are free/used. For the growth trend, you can look at (in 10g) Oracle EM. It has added now,Segment Growth Trend report which can show you for each object,comparing to the allocated space to the object,how much space is being used by it.
HTH
Aman.... -
How to get the values in separate columns
Hello Everyone
I am new to Bex, i have the sales data of 2008,2009,2010. now i have to display the sales order(key figure) for 2008,2009,2010 in separate columns for each customer(dimension) in a single report , can any one help me how to get this done in bex.
Thanks
GuptaHi ,
You can achieve this either creating New Selections or Restricted Key Figures.
Right click on the structute>>>> New selcection>>> drag the year to right [ Right Click on it >>restrict it with 2008}>>>Drag the respected Key figure.
So u will get the values 2008 in seperate column.
COpy the New Selecten that u created and paste on the structure , chage the descriprion and year to 2009.
do the same for 2010.
Note:you can also achieve this by creating variable offsets.Check the following link
http://help.sap.com/saphelp_bw33/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
Regards,
Ranganath -
How to update the value of a column when a row is deleted
Hi,
My requirement is basically i have a table .Below is a sample data along with sample data
Column A Column B ColumnC
1 SAM 0
2 RAM 0
Now if i run a delete statement saying
delete from Table where ColumnA =1 then i want to see the value of ColumnC to be updated as 1.The row shouldnt be deleted however the value of ColumnC should be changed to 1.
Can someone please help me with any suggestions? I can create a trigger but i havent worked with triggers so not sure on how to use it.
Please let me know if i am unclear or if you need any details.
ThanksAs I understand what you need is an INSTEAD OF DELETE trigger like below
CREATE TRIGGER Trg_TableName
ON TableName
INSTEAD OF DELETE
AS
BEGIN
UPDATE t
SET ColumnC = 1
FROM TableName t
WHERE EXISTS (SELECT 1
FROM DELETED
WHERE ColumnA = t.ColumnA
END
this will set ColumnC to 1 and will not do an actual delete of the row.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
How to get the values of all rows in advanced table
HI All,
I am using an advanced table to enter the values for the service contract line (its a custom page)in that advanced table i ahave column with lov called task number for that task number once i had choosed one task number and creating one more row using add anethor row button i want to restrict the user to not to choose the task number which was entered in the previus row.
Or if this is not possible i want to restrict the user by showing an error message when click on the submit button by saying you have choosed the duplicate task number please choose a uniqu task number
please give some hints
thanks
ajayHi
your approach will have two steps
1.) use the row refernce and get the value of task number of the row which is enterd by user .
2.) use getRows in range and compare values of task number of every row with the user selected value ,if value match then throw error.
Thanks
Pratap -
How to get the values of last selected row in Table?
Hi,
I have one editable table , where i have Create, Delete and Commit operation on it.
When i am clicking on Create button it add new row to my table.
But I want the value of my last selected row from the table in my Bean.
Can anyone suggest me please....... its urgent
Jdev:- 11.1.1.0.3
Thanks,
Ramitjust get this code empTable is the table binding
RowKeySet rks = new RowKeySetImpl();
CollectionModel model = (CollectionModel)empTable.getValue();
RowKeySet selectedRowKeys = empTable.getSelectedRowKeys();
if (selectedRowKeys != null)
Iterator iter = selectedRowKeys.iterator();
if (iter != null && iter.hasNext())
empTable.setRowKey(iter.next());
model.setRowIndex(empTable.getRowIndex());
Object key = model.getRowKey();
rks.add(key);
empTable.setSelectedRowKeys(rks);
AdfFacesContext.getCurrentInstance().addPartialTarget(empTable);
public void setEmpTable(RichTable empTable) {
this.empTable = empTable;
public RichTable getEmpTable() {
return empTable;
} -
How to calculate the value of key figure by considering other char or kf
Hi
My requirement is like this:
I have a key figure which gives me the planned issues and receipts but i know that if only from locaton is blank and to loc is filled then that are receipts and if both the from and to location values are filled then it is issues,
can you pls let me know how i 'll put this logic in th reporting bex and how i achieve this by user exit or any other way
thx
rubaneCreate two RKF, restrict first with [ from = '#' ] to get the planned receipts, and restrict the second with [ from <> '#' and to <> '#' ] to get the issues.
-
How to calculate the value from prompt and use the value as filter
Hi everyone,
I am designing a OBI query. I want to write a query and one of it filters comes from the dashboard prompt. Say I want to make a query to pull out the record for 3 consective years and user wants to enter the last year # and omit entering the first 2-year code#.Thanks!Hi,
if i understand your question
you have a prompt for year.. and it's assigned with presentation variable, say: var_year
And you are just entering value for only one year, say 2000.
Then, the request (which is using that prompt value as filter) should display year values 2000, 2000-1 (i.e. 1999), 2000-2 (i.e. 1998).
Is this your requirement?
If then,
Hope you are using edit box as control for year prompt and assign a presentation variable for that prompt.
Now, in report go to filter of year prompt, click on advance > Convert this filter to SQL.
write here... *Times.Year between @{var_year} and @{var_year}-2*
And make sure that your var_year is integer, if not cast it to integer -
How to bind the values of a RFC to a table element in WDA
Hi,
I have a RFC that returns some set of rows for a particular pernr.I want to bind this RFC to a table element in WDA.
please let me know how to do this and points will be rewarded for the helpful anwersHi,
Pl post in Web Dynpro ABAP
This tutorial may help https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7a89b067-0801-0010-8192-a9896a60938e
If its WD java
bind the datasource to the RFC model node
Regards
Ayyapparaj -
How to fix the width of sorting column about adf table ?
I develop project with ADF in jdeveloper.
When click on the sorting column header in adf table,it will adjust the width of the sorting column header.It will make page shifting.
How can I do to avoid the adjusting ?
How can I do to fix the width of soting table header?
Any hint will be appreciated.
Thank you!
Message was edited by:
user618145I have set the column width like this:
in style.css:
/** Column Settings **/
af|column::header-text
background-color:#F0EDE1;
color:#000000;
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
font-weight:bold;
padding-left: 2px;
padding-right: 2px;
padding-top: 3px;
padding-bottom:3px;
border-color: #B5B5B5;
WIDTH: 120px;
af|column::sortable-header-text
background-color:#F0EDE1;
color:#000000;
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
font-weight:bold;
padding-left: 2px;
padding-right: 2px;
padding-top: 3px;
padding-bottom:3px;
border-color: #B5B5B5;
WIDTH: 120px;
and in jsp page,write like this:
<af:panelBox text="test" width="1000" background="dark" >
<af:table emptyText="" value="#{ftOverview.listOfTransefersVect}" var="transfers" width="100%" banding="row" bandingInterval="1">
<af:column sortable="true" sortProperty="transactionId" headerText="#{resources['ft_overview.ref']}" formatType="text" width="39"
noWrap="true">
<af:outputText value="#{transfers.transactionId}" escape="false"/>
</af:column>
</af:table>
</af:panelBox>
but it seems doesn't work well.
Maybe you are looking for
-
Conditions not appearing in the display mode of Purchase order
Hi, We are facing an issue where in the display mode of Purchase order,if I click on the conditions tab in the item details, Iam getting a blank screen. But if I trigger the pricing procedure in the change mode for eg. by changing the quantity or pr
-
When I try to listen to some music, I get a Launch Application box asking me to choose an application. Is there a way whereby a drop down list of appropriate applications could be displayed? I've tried WMP but that doesn't work. Apologies for bei
-
Unable to generate graph in OBIEE 11g
Hi All, I have four columns in the report, one dimension and three fact columns Dim.Col1 Fact.Col2 Fact.Col3 Fact.Col4 Fact.Col4 is nothing but I am dividing Col2 and Col3 like this, so in the formula for Fact.Col4, I have this Fact.Col2/Fact.Col3 an
-
My ihone 2g suddenly could not recognized by windows xp???
i have iphone 2g. suddenly 1 week ago it could not recognized by windows xp.my other aaple device work properly on same wondows.what can i do for iphone 2g?
-
Selection variable for next month in RFPERIOD_OPEN in closing cockpit
Hi, we would like to use RFPERIOD_OPEN in the closing cockpit in order to open the next period on D-10 automatically. I would like to use the selection variables of the closing cockpit in the program variant in order to avoid unnecessary variant main