I’m having some difficulty in understanding how(or IF) I can concatenate values from multiple rows.
I’m using BOE XI R2.
I’ve created a Webi that lists States and Sales amounts.
So far, so good.
What I’d like to be able to do is to concatenate all of the State names that I’ve selected into one long comma separated string:
e.g. Alabama,Alaska, Arizona, Michigan, New Mexico . . . . etc.
I come from a Crystal Reports background where this is easy to do.
It must be possible in Webi too (right??)
I have similar question. I have two tables. One is shipment the other package details. A shipment can have multiple packages. would like to see in report as one row: shipment and the multiple package id’s concatenated vs a row for each package. Can i do that? if so how?
I’m not really sure why you want to concatenate values in this way but you may try this (or something like this);
=[State]+Previous([State])+Previous(Previous([State])) .
On MS SQL Server 2005 onwards, we use following trick to concatenate multiple column values and return a single row:
create table #t(i int, val int)
insert into #t values(1,1)
insert into #t values(1,2)
insert into #t values(1,3)
insert into #t values(1,4)
insert into #t values(1,5)
insert into #t values(1,6)
insert into #t values(1,7)
insert into #t values(2,10)
select * from #t
select distinct i ,REPLACE((select cast(val as varchar)+',' from #t t1 where t1.i=t2.i
for XML path(''))+'$',',$','') as val
from #t t2