This is a data issue. Try not to solve such problems in the frontend/UI. Especially in apps with a lot of data. Such solutions are going to reduce the performance (more aggregations on the fly)
In the script you can use ApplyMap function to create such grouping
(For example) In the script below the have Mapping table contains all Items
that are requiring re-mapping (grouping in your case)
This table is used to create new field (ItemsGrouped
) which will contain the new values (if the Items
field is not a key to another table you can overwrite it with the ApplyMap
instead of creating new field). This field can be shown in the UI and will contain these values:
Item1
Item2
ItemX2
ItemsMapping:
Mapping
Load * Inline [
Old , New
Item3, ItemX2
Item4, ItemX2
];
Data:
Load
....
Items,
ApplyMap('ItemsMapping', Items) as ItemsGrouped
From
MyData.qvd
;