you will need to sort by both item and rate, then ...
# advancedpdf
s
you will need to sort by both item and rate, then keep track of the previous item and rate in two variables, plus a third for the item/rate subtotal. if either of the current item or rate don’t match the previous values, then start a new group and reset the subtotal to 0.
🥲 1
c
you wouldn't happen to have a handy example I could repurpose would you?
s
It should be something like this (not tested, but adapted from the code I used which was grouping by item and location)
however, in order to make this work, you need to define a custom transaction line formula field, which concatenates item and rate, so that you can sort by that formula field. Change
custcol_my_sort_field
to match your custom sort column script id.
❤️ 1
m
Here's another example of grouping that may help
You might be able to chain `?sort_by`'s and get away without a custom field
❤️ 1
👀 1
s
i never thought of chaining sort_by’s but if that workes, that would be great