Combine data in one cell

Hi all

this is how data comes in the report

Col1 Col2 col3 col4

614201 6/12/2010 121213 HF
614201 6/12/2010 121213 BG
614201 6/14/2010 121219 HD
614201 6/14/2010 121230
7654321 1/1/2009 1003038373 07
7654321 1/1/2009 1003038373 51
7654321 1/1/2009 1003038373 52
7654321 1/1/2009 1003038373 65
7654321 1/1/2009 1003038373

Blank spaces are null values

but requirement is

Col1 Col2 col3 col4

614201 6/12/2010 121213 HF;BG
614201 6/14/2010 121219 HD
614201 6/14/2010 121230 NULL
7654321 1/1/2009 1003038373 07;51;52;65;NULL

Tried to use the col4+previous(self) but it gives only 2 values concatenated, but i want all the values separated by";" when col1,col2, col3 rows data are same

thanks in advance


prabhu_pramod (BOB member since 2010-06-17)

You can go through This .

Second thing, you can use

 =if(IsNull([object]);"NULL";[object]) 

to show NULL values.


Prashant Purohit :india: (BOB member since 2009-02-18)

Create Measure Object for Col4 in Universe

rpad(col4,length(col4)+1,’;’)

In properties tab put function as “Sum”


patriot3029 :india: (BOB member since 2006-12-08)

This is a very interesting solution to the problem. I believe you may have answered several individuals questions with this answer.

Any ideas on how to prevent duplicate data?


RothMan777 :us: (BOB member since 2008-04-04)

What do you mean by duplicate , Can you explain with example …


patriot3029 :india: (BOB member since 2006-12-08)

I am wondering if this really works :shock: I don’t have an access to Oracle DB now to test it :expressionless:

Other solutions to the original question can use these techniques:


Marek Chladny :slovakia: (BOB member since 2003-11-27)

I tested this using City names. So if I have a table that contains rows like:

ID City
1 New York
2 Chicago
3 Miami
4 New York
5 Atlanta
6 Miami

Using your suggestion above, I received:
New York;Chicago;Miami;New York;Atlanta;Miami

What I would really like to see is the same list without the duplicate values:
New York;Chicago;Miami;Atlanta

Thoughts?


RothMan777 :us: (BOB member since 2008-04-04)

Try this …pull completed data for table and see with wich column these values are dividing .

I mean

Newyork
chicago
Newyork
chicago
.
.
.
.


patriot3029 :india: (BOB member since 2006-12-08)

Hi Marek,

I am doing same thing , But you are using only 2 columns . My solution should work for unique records .

It is working for me fine on Oracle DB


patriot3029 :india: (BOB member since 2006-12-08)