3 Replies Latest reply on Dec 9, 2014 3:49 PM by J.M.Schomburg

    Portal sub-total rows?

    J.M.Schomburg

      Title

      Portal sub-total rows?

      Post

      Hello,

      I'm new to this, so please forgive any oversights.

      I have a portal in which I would like to insert 'empty' lines that would hold sub-totals; I've arranged a 'manual sort' script that would allow me to put them in any order. What I would like to do is 'accumulate' the amounts (row totals) until that sub-total 'empty' line (detected by its unique ID) that would reset the counter to zero for the next rows down (until the next 'empty' placeholder).

      This would be possible if I could carry the line total from one record (row) down to a field in the next (for recalculation), but I can't seem to find any feasible means of doing so.

      Thanks for any advice,

      Josef.

        • 1. Re: Portal sub-total rows?
          philmodjunk

          GetNthRecord can be used with the Get (RecordNumber ) function to refer to preceding (or trailing) records in the portal.

          • 2. Re: Portal sub-total rows?
            J.M.Schomburg

            That's amazing! So GetNthRecord(targTotal; Get(RecordNumber) - 1).

            It works, thanks a million! ; )

            • 3. Re: Portal sub-total rows?
              J.M.Schomburg

              Hey, just an update/conclusion: I managed to get a working version through "custom functions"... using the GetNthRecord function (but not the previous line like I had asked). Basically you make a special 'item' that will appear in the record, and have a calculation field a) dectect if it is the 'special' subtotal item then b) sum up all the records above it.

              I added an extra level by getting a subtotal item to store the previous subtitle item and subtract it from its total, meaning that you can have a list of records broken by subtotal lines that will give totals below the last subtitle line, and they can be placed anywhere you like.

              I added a third level by making the record rows manually sortable into any order.

              I could post the code if anyone's interested - it's not really that complicated, and I owe the drag n' trop/record order technique to someone else.

              Thanks for your input, laters,

              Josef.