How to split data into tables based on the entries in a column?
My problem is very similar to this thread: how to link data from one numbers sheet to another sheet, however I could get it to work the way described there. I have one big table for entering data (the first one). I would like to have a few other tables populated automatically based on the entries in one of the columns of the first table. In my example below I put everything in one sheet for clarity. The selection to the other tables is to be done on the column "fruit" in the first table. (second one is "oranges", then "apples" and then "pears" -- had to cut the width of my screenshot due to the limitations of Apple's forums).
Here is what it would look like, just cannot figure out how to make it happen automatically.
Tried also importing similar Excel example to Numbers, but the import did not work correctly.
Any help will be appreciated.
LD
Larry,
Here's an approach that I've used...
In the Purchases table, Aux column, the expression is:
=COUNTIF($A$1:A2, A) & "-"&A
Fill Down
This expression builds a string that identifies the item and the ocurrance of that item.
The Date column of the Summary tables, cell a3, contains:
=IF(ROW()-3<COUNTIF(Purchases :: $A,$A$1), LOOKUP(ROW()-2&"-"&$A$1, Purchases :: $F, Purchases :: B), "")
Fill Across, then fill down.
Regards,
Jerry
Similar Messages
-
How to view data in tables by selecting the synonym from the database objec
I could not figure out how to view data in tables by selecting the synonym from the database objects navigation tree. I had to first choose the synonym, view the details of the synonym to determine the table name, and then select the table from the database objects tree. Is this the only way available?
This functionality currently does not exist. I don't see it on the 1.1 statement of direction either, so perhaps someone from Oracle can give some insight as to when this could be expected.
Eric -
How to insert data into table control
hi experts,,
i have inserted data into data base table through table control .
now i want to insert data into table control through database table.
how to delete data from table control for selected rowHi
go through this link.
http://www.****************/Tutorials/ABAP/TableControl/Demo.htm -
Query for inserting data into table and incrementing the PK.. pls help
I have one table dd_prohibited_country. prohibit_country_key is the primary key column.
I have to insert data into dd_prohibited_country based on records already present.
The scenario I should follow is:
For Level_id 'EA' and prohibited_level_id 'EA' I should retreive the
max(prohibit_country_key) and starting from the maximum number again I have to insert them
into dd_prohibited_country. While inserting I have to increment the prohibit_country_key and
shall replace the values of level_id and prohibited_level_id.
(If 'EA' occurs, I have to replace with 'EUR')
For Instance,
If there are 15 records in dd_prohibited_country with Level_id 'EA' and prohibited_level_id 'EA', then
I have to insert these 15 records starting with prohibit_country_key 16 (Afetr 15 I should start inserting with number 16)
I have written the following query for this:
insert into dd_prohibited_country
select
a.pkey,
b.levelid,
b.ieflag,
b.plevelid
from
(select
max(prohibit_country_key) pkey
from
dd_prohibited_country) a,
(select
prohibit_country_key pkey,
replace(level_id,'EA','EUR') levelid,
level_id_flg as ieflag,
replace(prohibited_level_id,'EA','EUR') plevelid
from
dd_prohibited_country
where
level_id = 'EA' or prohibited_level_id = 'EA') b
My problem here is, I am always getting a.pkey as 15, because I am not incrementing it.
I tried incrementing it also, but I am unable to acheive it.
Can anyone please hepl me in writing this query.
Thanks in advance
Regards
RaghuBecause you are not incrementing your pkey. Try like this.
insert
into dd_prohibited_country
select a.pkey+b.pkey,
b.levelid,
b.ieflag,
b.plevelid
from (select max(prohibit_country_key) pkey
from dd_prohibited_country) a,
(select row_number() over (order by prohibit_country_key) pkey,
replace(level_id,'EA','EUR') levelid,
level_id_flg as ieflag,
replace(prohibited_level_id,'EA','EUR') plevelid
from dd_prohibited_country
where level_id = 'EA' or prohibited_level_id = 'EA') bNote: If you are in multiple user environment you can get into trouble for incrementing your PKey like this. -
How can split data into multiple sheets using an excel template
Hi all,
I'm using BIP 10.1.3.4.1 upgrated with the latest rollup patch, 9546699.
I followed the example inside the article "Real Excel Templates 1.5" (on the Tim Dexter's blog)
http://blogs.oracle.com/xmlpublisher/2010/05/real_excel_templates_i.html
and I built my report directly from an excel template containing only one sheet (plus the XDO_METADATA sheet), and for one sheet it worked fine !!!
Now I need to add more sheets to the template.... and I have two big questions:
1. if I need to create a second sheet which contains almost the same data (with a different layout), I saw that it is not possible to map a value to more than 1 cell....so if I map a value in the first sheet, I can't map it in the second sheet (because it's already used in the first one).
How can I map same values into two or different execll
2. if I need to create a second sheet which contains another dataset (completely different from the dataset in the first sheet), I can I do, considering that every BIP report is based on ONLY a data source.
Tim wrote: The most impressive, for me at least, is the sheet 'bursting'. You can split your hierarchical data across multiple sheets and dynamically name those sheets
but I didn't yet understand how this bursting it's possible.....considering what I said above.....
Surely I've a lack of knowledge.....but anybody can help me to understanding the "multiple excel sheets" black hole ?
I'll appreciate any kind of help
Thanks in advance
AlexYou can find working solution here http://xlspe.com
-
How to load data into table Using Script Task
We have a directory/folder where we have a file. We need to insert the File Created Date , File Name , Extension into the database table of Sql server by using Script Task.
So could you please suggest , how to frame the connection string , fetch the file details and insert the data into the database table using Script Task of SSIS 2008You can achieve it as follows using standard script task
1. Add a ForEachLoop container to point to your directory to iterate though the files. Add a variable of type string inside loop to get file name of each file it iterates. Choose option Filename and extension. Add a variable to just store extension part
(FileExtension), set EValuateAsExpression true for it and give expression as below
SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],".",1)+1,LEN(@[User::FileName]))
2. Add a script task inside loop and pass filename variable as a read only variable to it. Crete a new variable to get creationdate and pass it as ReadWrite. Inside write code as below
Public Sub Main()
' Add your code here
Dim f As New System.IO.FileInfo(Dts.Variables("FileName").Value.ToString())
Dts.Variables("FileCreatedDate").Value = f.CreationTime
Dts.TaskResult = ScriptResults.Success
End Sub
3. Add a Exec SQL Task after Script task inside loop and give a query like below
INSERT INTO TableName (FileName,CreatedDate,Extension)
VALUES(?,?,?)
and in parameter tab map the parameter placeholders 0,1 and 2 to @[User::FileName],@[User::FileCreatedDate] & @[User::FileExtension] variables
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to subdivide 1 large TABLE based on the output of a VIEW
I am searching for a decent method / example code to subdivide a large table (into a global temp table (GTT) for further processing) based on a list of numeric/alphanumeric which is the resultset from a view.
I am groping with the following strategy in PL/SQL:
1 -- set up cursor, execute the view (so I have the list of identifiers)
2 -- create a second cursor (or loop?) which:
accepts each of the identifiers in turn
executes a query (EXECUTE IMMEDIATE?) on the larger table
INSERTs (or appends?) each resultset into the GTT
3 -- Then the GTT contains just the requires subset of the larger table for further processing and eventual import into iReport for reporting.
Can anyone point me to code that would "spoon feed" me on this? Or suggest the best / better way to go about it?
The scale of the issue here -- GTT is defined and ready to go, the larger table contains approx 40,000 rows and I need to extract a dozen subsets or so which add up to approx 1000 rows.
Thanks,
RobWelcome to the forum!
>
I am searching for a decent method / example code to subdivide a large table (into a global temp table (GTT) for further processing) based on a list of numeric/alphanumeric which is the resultset from a view.
Can anyone point me to code that would "spoon feed" me on this? Or suggest the best / better way to go about it?
The scale of the issue here -- GTT is defined and ready to go, the larger table contains approx 40,000 rows and I need to extract a dozen subsets or so which add up to approx 1000 rows.
>
No - there is no code to point you to.
As many of the previous responses indicate part of the concern is that you seem to have already chosen and partially implemented a solution but the information you provided makes us question whether you have adequately analyzed and defined the actual problem and processing that needs to happen. Here's why I have questions about your approach
1. GTT - a red flag issue - these tables are generally not needed in Oracle. So when you, or anyone says they plan to use one it raises a red flag. People want to be sure you really need one rather than not using a table at all, or just using a regular table instead of a GTT.
2. Double nested CURSOR loops - a DOUBLE red flag issue - this is almost always SLOW-BY-SLOW (row-by-row) processing at its worst. It is seldom needed, doesn't perform well and won't scale. People are going to question this choice and rightfully so.
3. EXECUTE IMMEDIATE - a red flag issue or at least a yellow/warning flag. This is definitely a legitimate methodology when it is needed but may times developers resort to it when it isn't needed because it seems easier than doing the hard work of actually defining ALL of the requirements. It seems easier because it appears that it will allow and work for those 'unexpected' things that seem to come up in new development.
Unfortunately most of those unexpected things come up because the developer did not adequately define all of the requirements. The code may execute when those things arise but it likely won't do the right thing.
Seeing all three of those red flag issues in the same question is like waving a red flag at a charging bull. The responses you get are all likely to be of the 'DO NOT DO THAT' variety.
You are correct that a work table is appropriate when there is business logic to be applied to a set of data that cannot be applied using SQL alone. Use a regular table unless
1. you plan to have multiple sessions working with the table simutaneously,
2. each session needs to work with ONLY their own data in that table and not data from other sessions
3. the data does NOT need to be available after the session ends
4. you actually need a GTT to take advantage of the automatic data preservation (ON COMMIT PRESERVE/DELETE) functionality
Remember - when a session ends the data in the GTT is gone. That can makek it very difficult to troubleshoot data related problems since a different session can't see what data is in the table. Even if a GTT is needed for the final product it is very useful to use a regular table so that the data can be examined after test runs to help find and fix problems. Then after development is complete and initial testing is done a GTT would be substituted and final testing performed.
So the main remaining question is why you need to perform multiple dynamic queries to get the data populated into the work table? Especially why is a nested cursor loop needed? My suspicion is that you have the queries stored in a query table and one of your loops extracts the query and executes it dynamically.
How many queries are we talking about? Do these queries change from run to run? Please provide more detail of the process and an example query for the selection filtering as well as a typical dynamic query you plan to use. -
Input field validation in a Table based on the value of other column
Hi all
I have a table with 2 columns. column1 is of text view and column2 is Input field.
The user should not be allowed to enter a value in the column2 ( input field) greater than the value populated in column1(textview).
So for Eg; if the column1 is populated with value 100, The user should not be able to enter a number greater than 100 in the column2 input field.
Please let me how this can be achieved.
I appreciate the help.
ThanksHi,
Let me make sure u r working with table control.
First u have to create a event(VALIDATE) to do the validation.
Inside the event,
1. First get the current index where user has pointed the curson
2. Once u get the index read the internal table with index value.
3. Now u can compare the col1 and col2 values and populate the error message.
1. DATA : lo_elt TYPE REF TO if_wd_context_element,
l_index type i.
lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
CALL METHOD LO_ELT->GET_INDEX( RECEIVING MY_INDEX = l_index.
above code should be written inside the event.
Thanks, -
"How do you build a filter based on the conditions of two columns?"
Hi all,
line desc Period Amount1 Amount2
jan feb 0 10
jan mar 0 20
jan jan 0 30
jan apr 0 40
I have a report like this with four columns
Line Descr is from one table and period from other table and amounts 1 and amounts 2 are respective amounts.
now i need to see the only one column in the Result i,e. jan jan 0 30
I need to write a sql in the column formula so that i need to get this Result
Any suggestions like what sql do i need to write
thanks
Xavier.
Edited by: Xavier on Jul 1, 2011 12:03 PM
Edited by: Xavier on Jul 1, 2011 12:04 PM
Edited by: Xavier on Jul 1, 2011 12:05 PM
Edited by: Xavier on Jul 1, 2011 12:05 PM
Edited by: Xavier on Jul 1, 2011 12:06 PM
Edited by: Xavier on Jul 1, 2011 12:07 PM
Edited by: Xavier on Jul 2, 2011 11:37 AMDavid,
Thank you very much for your Reply.I was looking,who could understand my situation and guess "YOU DID'
I'll tell my situation David.
We used to have a sql filter for this Report .In 11.1.1.3 version it used to work ,but in 11.1.1.5 we have a bug .if you have a sql filter in the Report it is not allowing us to use navigation links on that report it is saying some "Assertion Error".
We are using this Report on Dashboard .If we use the report on Dashboard and if that Report contains the Sql Filter than it's throwing the "ASSERTION ERROR".
but if i open the same Report from the catalog then the navigation links works fine
Can you help me out with this one .
Thanks
Xavier -
HOW TO SAVE DATA FROM TABLE A AND TABLE B INTO TABLE C
Hi,
I have a table called EMPLOYEE , GROUP and EMPLOYEE_GROUP
table EMPLOYEE contains emp_id, emp_name, emp_dep and emp_level
table GROUP contains group_id and group_description
table EMPLOYEE_GROUP contains emp_id and group_id (emp_id is a primary key)
I want to assign each employee to a group based on their department and level..
How can I assign many employees to one group?
But each group have the limit number.
My screen would be :
1. search employees based on their department and level
2. assign each employees to a group
*3. save the data into table EMPLOYEE_GROUP (where the process should save the emp_id and group_id into table EMPLOYEE_GROUP)*
Thank you in advance!Hi Rakesh,
Thank you for your valuable information that you post...
I made 1 to many relationship between employee and group.
I want to assign each employee to a group...so one employee can only have one group but one group can contains many employees..
When I run the application, I have an error when i try to save many employees into one group...
master table is group, detail table is employee
error : Too many objects match the primary key oracle.jbo.Key
Hope that you could help me with this..
Thank You. -
How to upload data into ztables
Hi all,
How to upload data into ztables
plz sent the detail description as well sa sample programsHi Narendra,
Sample code to update the Z db table :
REPORT yupload.
TABLES ybtab.
DATA itab LIKE ybtab OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
filename = 'C:\data.txt'
filetype = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = itab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
INSERT ybtab FROM TABLE itab.
ENDIF.
Schedule this program as a Background Job with required time paramters .
Regards,
Ramganesan K. -
Its very urgent:how to insert data into database tables
Hi All,
I am very new to oaf.
I have one requirement data insert into database tables.
here createPG having data that data insert into one custom table.
but i dont know how to insert data into database tables.
i wrote the code in am,co as follows.
in am i wrote the code:
public void NewoperationManagerLogic()
ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
OADBTransaction oadbt=getOADBTransaction();
if(!vo1.isPreparedForExecution())
vo1.executeQuery();
Row row=vo1.createRow();
vo1.insertRow(row);
in createPG processrequest co:
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
am.NewoperationManagerLogic();
process form request:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("Submit")!=null)
ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
am.getOADBTransaction().commit();
please help with an example(sample code).
its very urgent.
thanks in advance
Seshu
Edited by: its urgent on Dec 25, 2011 9:31 PMHi ,
1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
Thanks
Pratap -
How to insert data into the mysql table by giving as a text file
Hi,
Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
Thanks:)At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).
-
How can I load data into table with SQL*LOADER
how can I load data into table with SQL*LOADER
when column data length more than 255 bytes?
when column exceed 255 ,data can not be insert into table by SQL*LOADER
CREATE TABLE A (
A VARCHAR2 ( 10 ) ,
B VARCHAR2 ( 10 ) ,
C VARCHAR2 ( 10 ) ,
E VARCHAR2 ( 2000 ) );
control file:
load data
append into table A
fields terminated by X'09'
(A , B , C , E )
SQL*LOADER command:
sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
datafile:
column E is more than 255bytes
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)
1 1 1 1234567------(more than 255bytes)Check this out.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961 -
How can i open a DOC or TXT file and insert the data into table?
How can i open a DOC or TXT file and insert the data into table?
I have a doc file . the doc include some columns and some rows.(for example 'ID,Name,Date,...').
I'd like open DOC file and I'd like insert them into the table with same columns.
Thanks.Use the SQL*Loader utility or the UTL_FILE package.
Maybe you are looking for
-
[JS CS3] Show Text Threads
Does anyone know the syntax to script the View > Show Text Threads command in CS3? It seems that it should be something like: app.activeDocument.viewPreferences.showTextThreads ...but that isn't in the DOM. I can't seem to locate it. Can this be done
-
I have just bought a new Audigy 2 ZS, but I have a question regarding the possible use of the digital out of the card for my Logitech 560 speakers, with some kind og adabter/converter, as I find it to be quite a hassle to crawl under my desk everytim
-
WHAT BACKUP STARTEGY DO I USE PS ADVICE
I run my production database on AIX OS, we currently backup the Oracle 11g database once a month using Filesystem on AIX to tape using TIVOLI, i want to change the backup strategy to use RMAN to back up to tapes, House please what do you recommend, d
-
PARAGRAPH displayed in the PDF file
Hi, I have a issue in the PDF file I see PARAGRAPH wriiten after the actual data is displpayed. How can I remove those "PARAGRAPH" <-- written in the PDF file. Thank You, SB.
-
I don't have a ton of experience with Labview, but I'm trying to get the Stanford Research Systems SR400 gated photon counter to use a fixed gate mode to count. I looked at the example driver that I found and realized that it isn't capable of doing