Merging 2 rows data into a single column in OBIEE 11g
Hi All,
Requirement is "Merging 2 rows into a single column"
Scenario: data from table called *"transactions_table"*
Id ------------- transaction no ----------------------- transaction name -------------------------------quantity
100 ----------- 1 ----------------------- abc ------------------------------ 1000
100 ----------- 2 ------------------------ def ------------------------------ 2000
Required out put:
Id ----------------- Transactions & Quantity
100 -------------- abc(1000),def(2000)
Please provide me solution, and let me know if any additional information is required.
Thanks in advance to all of you.
Regards,
chrs
check the below link, that may help you.
Re: Horizontal value display
If it is helpful, please mark as correct or helpful
Similar Messages
-
Merging 2 rows data into a single column in OBIEE
Hi All,
Requirement is "Merging 2 rows into a single column"
Scenario: data from table called "transactions_table"
Id
transaction no
transaction name -------------------------------quantity
100
1
abc
1000
100
2
def
2000
Required out put:
Id
Transactions & Quantity
100
abc(1000),def(2000)
Please provide me solution, and let me know if any additional information is required.
Thanks in advance to all of you.can you please share your data like below
column1, column2 .....
and where are you trying to do this? at answer or bi admin tool?
there are a few ways to do this. -
Using sql load insert multiple fields data into a single column in database
Hi ,
I have my log file in sun OS box something like this
=======
(07/29/2009 00:02:24.467) 367518 (07/29/2009 00:02:26.214) 949384011
(07/29/2009 00:02:26.236) 3675 (07/29/2009 00:02:28.207) 949395117
(07/29/2009 00:02:28.240) 337710 (07/29/2009 00:02:30.621) 949400864
=============
I am trying to insert the data into oracle data base as follows.
=============================
column1 : (07/29/2009 00:02:24.467)
column2 : 367518
column3 : (07/29/2009 00:02:26.214)
column4 : 949384011
===========================
Can anyone help me with the control file format?
someone suggested me the code below.
==========
LOAD DATA
INFILE 'D:\work\load.txt'
INTO TABLE sample
(col1 POSITION(02:24) char,
col2 POSITION(27:32) INTEGER EXTERNAL,
col3 POSITION(35:57) CHAR,
col4 POSITION(60:68) INTEGER EXTERNAL
===========
but this works only for the fixed length data? Please helpuser11744904 wrote:
Hi ,
I have my log file in sun OS box something like this
=======
(07/29/2009 00:02:24.467) 367518 (07/29/2009 00:02:26.214) 949384011
(07/29/2009 00:02:26.236) 3675 (07/29/2009 00:02:28.207) 949395117
(07/29/2009 00:02:28.240) 337710 (07/29/2009 00:02:30.621) 949400864
=============
I am trying to insert the data into oracle data base as follows.
=============================
column1 : (07/29/2009 00:02:24.467)
column2 : 367518
column3 : (07/29/2009 00:02:26.214)
column4 : 949384011
===========================
Can anyone help me with the control file format?
someone suggested me the code below.
==========
LOAD DATA
INFILE 'D:\work\load.txt'
INTO TABLE sample
(col1 POSITION(02:24) char,
col2 POSITION(27:32) INTEGER EXTERNAL,
col3 POSITION(35:57) CHAR,
col4 POSITION(60:68) INTEGER EXTERNAL
===========
but this works only for the fixed length data? Please helpIs the requirement to load all data in a single column or multiple columns? The thread subject and body are conflicting. -
All row data in a single column
i have a table with the following data
id name age salary dept city state country
1 abcd 22 20000 IT X Y XYZ
2 efgh 23 30000 IT X Y XYZ
i need the output as
1,abcd,22,20000,IT,X,Y
2,efgh,23,30000,IT,X,Y
in a single column separated by a comma(,)
is it possible to get?
please any one help me out with the sql/PL SQL queryselect col1 || ',' || col2 || ',' || ...
-
Concatenation of row data into a single row
Hi,
I have table which has the data in the following way.
col1 col2 col3
a 1 one
a 2 two
a 3 three
b 1 dfdf
b 2 sfdhh
c 1 zgdhi want data in the following way.
col1 col2 col3
a 1,2,3 one,two,three
b 1,2 dfdf,sfdhh
c 1 zgdhCan any body help me.
Thanks in advancemay be this will work
WITH tab AS
(SELECT 'A' col1,1 col2, 'one' col3 FROM dual
UNION ALL
SELECT 'A' col1,2 col2, 'two' col3 FROM dual
UNION ALL
SELECT 'A' col1,3 col2, 'three' col3 FROM dual
union all
SELECT 'B' col1,1 col2, 'abc' col3 FROM dual
UNION ALL
SELECT 'B' col1,2 col2, 'defg' col3 FROM dual
UNION ALL
SELECT 'C' col1,1 col2, 'hijcol' FROM dual
union all
SELECT 'C' col1,2 col2,'klm' col3 FROM dual
SELECT col1
, ltrim(MAX(SYS_CONNECT_BY_PATH(col2,','))
KEEP (DENSE_RANK LAST ORDER BY curr),',') AS col2,
ltrim(MAX(SYS_CONNECT_BY_PATH(col3,','))
KEEP (DENSE_RANK LAST ORDER BY curr),',')as col3
FROM ( SELECT col1
, col2,col3
, ROW_NUMBER() OVER (PARTITION BY col1 ORDER BY col2) AS curr
, ROW_NUMBER() OVER (PARTITION BY col1 ORDER BY col2) -1 AS prev
FROM tab )
GROUP BY col1
CONNECT BY prev = PRIOR curr AND col1 = PRIOR col1
START WITH curr = 1;
COL1 COL2 COL3
A 1,2,3 one,two,three
B 1,2 abc,defg
C 1,2 hijcol,klm -
How To Concatenate Column Values from Multiple Rows into a Single Column?
How do I create a SQL query that will concatenate column values from multiple rows into a single column?
Last First Code
Lesand Danny 1
Lesand Danny 2
Lesand Danny 3
Benedi Eric 7
Benedi Eric 14
Result should look like:
Last First Codes
Lesand Danny 1,2,3
Benedi Eric 7,14
Thanks,
David JohnsonStarting with Oracle 9i
select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
from
(select last, first, code, row_number() over(partition by last, first order by code) rn
from a)
connect by last = prior last and first = prior first and prior rn = rn -1
start with rn = 1
group by last, first
LAST FIRST CODES
Lesand Danny 1,2,3
Benedi Eric 7,14Regards
Dmytro -
Greetings.
I have successfully worked out inserting SQL data (2008 R2) into my 2010 SharePoint list (New, Update, Delete) by creating an SSIS Data Flow Task as outlined here:
http://fsugeiger.blogspot.com/2010/01/synchronise-sql-table-with-sharepoint.html
However, the problem I am running into is inserting data into the SharePoint Columns that are "Lookup" column types. I verified that all of the values I am copying from SQL into the SharePoint lookup column exist in the customn list it is pointing to. It
is important to have this column be a lookup column as it links to another custom list that has many more columns of related information.
I have read and re-read the SharePoint SSIS Adapters 2011.docx from
http://sqlsrvintegrationsrv.codeplex.com/ and the only section that seems to apply is this:
"Looking Up Values in a SharePoint List
If you have to look up a value in a SharePoint list, you can use the Lookup transformation in your data flow, and use the SharePoint List source to load the lookup table. You may have to add a Derived Column transformation or a Script component that splits
data in the lookup column on the ";#" delimiter to separate the ID value from the description.
If you are replacing values in your data with the values that you look up in the list, then loading the changed data back into SharePoint, you only have to include the ID from the lookup column. SharePoint ignores the description if you include it."
I am not sure if the above statement means that I should be passing the assocaited ID's other than the actual data into the SharePoint List destination. If that is the case, that will not really work as the lookup contains hundreds of rows. Not too mention
I have several of these lookup column types pointing to several different lists.
Any guidance in how I can put data into a SharePoint Lookup column type via Data Flow Task would be so much appreaciated.
Thank you.
My errors are:
Error: 0x0 at Data Flow Task, SharePoint List Destination: Error on row ID="1": 0x1 - Unspecified error, such as too many items being updated at once (batch), or an invalid core field value.
Error: 0xC0047062 at Data Flow Task, SharePoint List Destination [1903]: Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.PipelineProcessException: Errors detected in this component - see SSIS Errors at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListDestination.ProcessInput(Int32
inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "SharePoint List Destination" (1903) failed with error code 0x80131500 while processing input "Component Input" (1912). The identified
component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and willI have found a solution to my problem and thought I would share it here in case there are others who are struggling with the above scenario. If you have a better way, I would love to hear about it since my way is a bit tedious.
In a nutshell, in order to have an SSIS package put data from an OLE DB Source into a SharePoint List Destination Lookup Column, you need to pass the ID of the value that is being looked up, not the value that is in the “master” OLE DB source.
Rough explanation, OLE DB Source value for column “Approp” is “4005” --> SQL matches “4005” with the ID in the new lookup table (“4005” = ID “5” as defined in the SharePoint lookup list) --> “5” gets passed into SharePoint List destination lookup
column --> SharePoint displays “4005” and successfully links to the lookup list.
Funny thing (not really), the error(s) outlined in my original post are not related in getting data into a SharePoint Lookup column as I am now successful in getting data into the system but I am still getting the same above error(s). I think it has to do
with the ID column in the SharePoint list destination. What I can’t seem to figure out is why since I am not linking any data to that ID column (at least on new records). I am however linking it on Update and Delete and the errors mentioned above disappear
and things work well.
There are three tasks that need to get done in order to get data from SQL into a SharePoint lookup column assuming you have already set up your SharePoint lookup lists:
1. Create new lookup table(s) in SQL that has the IDs from the SharePoint Lookup list and the values coming from the “master” OLD DB Source. You can see the ID column in SharePoint by toggling it on in a view.
2. Create a SQL command that JOINs all the databases and tables so that the ID is passed and not the value into the SharePoint lookup column
3. Change the “Data access mode” to “SQL Command” instead of the “Table or view” in the OLE DB Source and paste your command into the “SQL command text:” area.
Other helpful info is that you may also need to add additional columns in the new lookup tables in SQL for the scenarios when the data is not unique. You can see this two times in my SQL command example for Units and JobTitles:
SELECT
pps.SSNm,
pps.file_updated,
pps.Employee_id,
/* pps.CheckDistNm,*/
Check_Distribution_id = COALESCE( d.ID, 0 ),
pps.Job_nbr,
pps.SeqNm,
pps.action_eff_dt,
Fund_id = COALESCE( f.id, 0 ),
Appropriation_id = COALESCE( ap.id, 0 ),
ActionCode_id = COALESCE( ac.id, 0 ),
SpecNumber_id = COALESCE( jt.ID, 0 ),
pps.Employee_id,
/* pps.Fund,
pps.Approp,
pps.Unit,*/
Unit_id = COALESCE( u.ID, 0 ),
PosNm,
PosCode,
pps.LastName,
pps.FirstName,
pps.MI
FROM
x_PPS.aReportVw.pps_screens_active AS pps
LEFT OUTER JOIN dbo.DistributionNumbers AS d ON
pps.CheckDistNm = d.Check_Distribution
LEFT OUTER JOIN dbo.Units AS u ON
pps.Fund = u.Fund AND
pps.Approp = u.Approp AND
pps.Unit = u.Unit
LEFT OUTER JOIN dbo.Appropriations AS ap ON
pps.Approp = ap.Approp
LEFT OUTER JOIN dbo.Funds AS f ON
pps.Fund = f.Fund
LEFT OUTER JOIN dbo.ActionCodes AS ac ON
pps.ActionCode = ac.ActionCode
LEFT OUTER JOIN dbo.JobTitles AS jt ON
pps.SpecNm = jt.SpecNumber AND
pps.JurisClass = jt.JurisClass -
How to insert more than 32k xml data into oracle clob column
how to insert more than 32k xml data into oracle clob column.
xml data is coming from java front end
if we cannot use clob than what are the different options availableAre you facing any issue with my code?
String lateral size error will come when you try to insert the full xml in string format.
public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
boolean isUpdated = true;
Connection connection = null;
try {
connection = ConnectionManager.getConnection ();
//connection.setAutoCommit ( false );
PreparedStatement PREPARE_STATEMENT = null;
String sqlQuery = "UPDATE " + tableName + " SET " + columnName + " = ? WHERE ID =" + id;
PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
// converting string to reader stream
Reader reader = new StringReader ( strContents );
PREPARE_STATEMENT.setClob ( 1, reader );
// return false after updating the clob data to DB
isUpdated = PREPARE_STATEMENT.execute ();
PREPARE_STATEMENT.close ();
} catch ( SQLException e ) {
e.printStackTrace ();
finally{
return isUpdated;
Try this JAVA code. -
__Is there a way to 'merge' multiple curves into a single curve?
__Is there a way to 'merge' multiple curves into a single curve?
By this I mean I have file with 2-12 curve layers - I wanted to 'merge' the curves so that I can end up with a single curve with the attributes of many. Maybe is there a script that would do this?I don't mean to be critical, but how do you get to a situation where you have 12 successive Curves layers?
The advantage to a Curves layer is that you can adjust and re-adjust it to your heart's content.
If you're habitually adding new Curves layers one over the other, maybe you should re-evaluate your process of working... Perhaps the way you're thinking you should just work at a high bit depth and do repeated Curves operations on the pixels? Or put some time into retraining yourself to not add a new Curves layer but to manipulate the one that's already there. There are some nice new enhancements (e.g., the "finger" subtool that allows you to choose a spot in the image and manipulate that part of the curve).
Again, I'm not trying to criticize you, just looking to see if maybe there's a way to avoid getting to the point where you need to combine Curves in the first place, since there's no direct "Merge Curves" capability, outside of just stamping a set of image and adjustment layers into pixels. For completeness I suppose I should mention how to do that... You can Stamp any combination of visible layers into a single layer of pixels (effectively combining all the Curves layers et. al.) by pressing Control - Shift - Alt - E.
-Noel -
SQL*Loader - How to combine Flat File 3 columns and put into one single column
Receive a flat file delimited by comma. Want to combine Flat File last 3 columns and put into one single column(Table).
e.g.
Flat File
100,239,30,20,30
While inserting into table want to combine last 3 columns and insert into invoice number column.
302030It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
Vijay -
How to concatenate two colums into one single column
I need some ideas to concatenate two different columns into one single column using a set of distinct values.
For Example,
Customer Product Number
xyz A 1
xyz B 2
xyz B 1
AAA C 7
AAA A 1
The result should look like this,
Customer Value
xyz A1 B2 B1
AAA C7 A1
How would I group this into once value ?
Thanks in advance ...Tom's discussion of writing your own aggregate routines
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402
starts off with a link to the 8i alternatives
"see
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:229614022562
for 8i methods (not aggregates)"
Unforutnately, it's a lot more work in 8i.
Justin -
How to send multiple row data into an internal table??
I have a view with table control.i want to select multiple row and send all the row data into an internal table.i am able to select multiple row but all the selected row data is not going to the internal table.....only a particular row data which is lead selected is going.
Do anyone can help me regarding this issue?
Thanks in advance,
Subhasis.Hey,
Some code example:
declaring an internal table and work area to get all the elements from the node.
data : lt_Elements type WDR_CONTEXT_ELEMENT_SET,
ls_Element type WDR_CONTEXT_ELEMENT_SET,
considering flights is my node.
lt_data type sflight.
Node_Flights is the ref of the node to which ur table is binded.
Use Code Inspector to read the node.
lt_Element = Node_Flights->GET_ELEMENTS
loop at lt_elements into ls_Element.
l_bollean = ls_elements->is_selected ( returns abap true/false ).
if l_bollean IS INITIAL.
append ls_Element to lt_data.
endif.
Hope this would help.
Cheers,
Ashish -
Loading data into a CLOB column
I need to find out how to load about ten sentences of data into a clob column for a table in the database. I have a pl/sql procedure that loads data from an xml file into various tables in the the database. Recently, we added a column (test_dummy) to one of the tables and defined it as a CLOB. There is a corresponding node (detail_info) in the XML file that maps to this column. I need to figure out how to incorporate this in the pl/sql procedure so that the data in the XML file for the node (detail_info) is loaded into "test_dummy". Any ideas?
Take it one at a time. Use 'extract' function to extract an XML snippet from a given XML. The question couldn't be more vague. Maybe an example would help?
Rahul -
Removing drag functionality of column in OBIEE 11g
Hi all,
Can any one say me how to remove the draging functionality for the columns in OBIEE 11g ? It is creating an issue for me when i hide the columns in pivot and has only rows over there. It is creating one more layer on the top of the measures.
Thanks for your help.Fightclub,
Edit the Pivot view and goto Row section -> Row Properties -> Option - Uncheck the Display Heading.
But you'll loose your columns heading of rows.
Thanks,
Balaa... -
Custom date format that can use in Obiee 11g
Hi,
I'm new here,
What are the date format could be use in OBIEE 11g?
can we custom like this: DD-MM-YYYY?is there any case sensitive like dd-MM-yyyy?
Please help
Joe
Edited by: JoeSSI on Mar 1, 2012 8:32 PMHi,
bot should work.refer the below
go to u r required columns -->right click and properties then select data format tab --> check it Override Default Data Format > select it custom option put u r required both option work.
if u kept it
DD-MM-YYYY ===> 01-03-2012 format u ill get
or
dd-MM-yyyy
Thanks
Deva
Maybe you are looking for
-
Hello, How can I measure the time it takes for a task to be executed in SAP BPM? Is there an standar report for analyze all the process and help making decisions? Thanks & Regards SU
-
Calling a webservice having an abstract element
hi , I want to call a webservice which takes one element namely "data" as part of request info.But "data" is of abstract type and "EnterpriseData" is another element which is of type "data" . So when I form the request object as <mx:request> <data></
-
Itunes is running but will not open after most recent 9.1 update w/Bonjour
I recently loaded the most recent update for Itunes 9.1 version on 3/31. Since then, I have not been able to open my Itunes. I think it might be related to Bonjour because I see that it was added during my most recent update and I have never had it o
-
I have a new email address and would like to change it in itunes. Can I edit my account with the new address or do I have to create a new account? Will this cause any problems with music/apps that I have already purchased?
-
A problem while installing Safari 5? safari.cab?
"The cabinet file 'Safari.cab' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package." This is the problem. I downloaded diffrent versions o