I have a data in rows like this for id 1
id1 a1
id1 b2
id1 c3
id1 d4
id1 e5
I like to combine it as "a1b2c3d4e5" into a single value for id1. Thanks in advance.
You will need to create a FORMULA to concatenate these strings. In the Field Explorer , right click the Formula Fields and select New. It will prompt you for a Formula Name. Enter the name of your choice, and hit enter.
One approach is the "3 Formula" method. You set up an initialising formula in each header, with the evaluation time directive "WhilePrintingRecords". This approach was the only one available for doing running totals in the "good ol' days" before RunningTotal objects were available.
For example:
In the Group Header :- Have a Formula @InitiliseRT
WhilePrintingRecords;
StringVar ConcatenatedID;
If Not InRepeatedGroupHeader Then
ConcatenatedID := "";
In the Details Section :- Have a Formula @UpdateRT
WhilePrintingRecords;
StringVar ConcatenatedID := ConcatenatedID + id1;
Finally, in the Group Footer you can see the result :- Formula @ShowRT
WhilePrintingRecords;
StringVar ConcatenatedID;
This should give you your final string of "a1b2c3d4e5".
If you need to, you can add extra formulas for extra groups, one variable for each group (e.g. ConcatenatedIDGroup1, ConcatenatedIDGroup2). The key is to always get the name right between the groups, and to initialise the variable in the group header.
There are limitations to the use of these formulas. The built in summary functions (Sum, Max, Count, ...) or RunningTotals cannot use them, and you cannot group on them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With