Discussion Board for collaboration related to QlikView App Development.
I have a straight table with sales info in columns like this:
SaleID Amount SalesPerson Region
A sale can have multiple Sale Persons on it. So I end up with 2 rows for 1 sale. Like this:
1 100 Tim USA
1 100 Sam USA
I would like to have it be on only one row:
1 100 Tim, Sam USA
Can I make an expression do this somehow? Thanks!
When your table is already loaded (I will call it OriginalTable)
you can make:
load SaleIdD, Amount, concat(SalesPerson',', ') as SalesPeople,
//if you don't change at least one field name you will have to use noconcatenate before LOAD statement
group by SaleID, Amount, Region;
drop table OriginalTable;// if you don't drop it's better to change field names
View solution in original post
maybe you can use concat() and group by clauses like this
SaleID,Amount,Region,Concat(SalesPerson,',') as SalesPersonConcatfrom/residentgroup bySaleID,Amount,Region
PS. depending on your data, maybe you can use max(Amount) or Avg(Amount) or Sum(Amount), instead of grouping by the field
I ended up just using the concat(SalesPerson',', ') in a expression and it works! hoooray!!