on 08-26-2021 12:19 PM
I'm looking for some help with a problem around grouping some data together and the best way to achieve it in a report.
Very simply, I have a table with a list of postcodes (string ie BA10), which is also split into two seperate fields PC1 (string - "BA") and PC2 (number - "10"). I'm trying to produce a report to group these together (by office).
Rather than having BA1, BA2, BA3, BA4 on four seperate detail lines, im trying to achieve either "BA1 BA2 BA3 BA4" as one formula/on one line, or even better would be "BA1-4" though i think that might be asking too much.
Hopefully the screenshot below helps explain things a little better. Any help/suggestions would be great. Thanks.
Try something like this:
1. Group on PC1
2. Create a formula like below to append PC2 to the end of PC1
{@PostalCode}
{table.PC1} + ToText({table.PC2}, 0, "")
3. Create a formula like below that will concatenate the postal code values for the PC1 group
WhilePrintingRecords;
StringVar postcodes;
If OnFirstRecord or {table.PC1} <> previous({table.PC1}) then
postcodes := {@PostalCode}
else
postcodes := postcodes + " " + {@PostalCode};
""
4. Put this formula in the details section and then suppress the details.
5. Create a final formula like below to display the concatenated values in the group footer:
WhilePrintingRecords;
StringVar postcodes
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assuming that you're also grouping on OfficeName, change the If statement in the middle formula from
If OnFirstRecord or {table.PC1} <> previous({table.PC1}) then
to
If OnFirstRecord or {table.OfficeName} <> previous({table.OfficeName}) then
-Dell
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.