Add an option for the aggregation "concatenate" to only concatenate distinct values
Seddryck opened this issue · 0 comments
Seddryck commented
At the moment if the field that must be concatenated contains the same value in different rows, this value is displayed multiple times in the concatenation.
Expl:
Supplier | Fruit | Qty |
---|---|---|
Foo | Apple | 50 |
Foo | Apple | 10 |
Foo | Banana | 20 |
Bar | Apple | 30 |
With the alteration
<summarize>
<concatenation column="Fruit" type="text" separator=", "/>
<sum column="Qty" type="numeric" />
<group-by>
<column identifier="Supplier">
</group-by>
<summarize>
Supplier | Fruit | Qty |
---|---|---|
Foo | Apple, Apple, Banana | 80 |
Bar | Apple | 30 |
But with the new attribute distinct
set to true
of this aggregation, we're able to only have once the fruit apple for supplier Foo
<summarize>
<concatenation column="Fruit" type="text" separator=", " distinct="true"/>
<sum column="Qty" type="numeric" />
<group-by>
<column identifier="Supplier">
</group-by>
<summarize>
Supplier | Fruit | Qty |
---|---|---|
Foo | Apple, Banana | 80 |
Bar | Apple | 30 |