Skip to main content
August 24, 2022
Question

Showing difference of two row in paging Grid

  • August 24, 2022
  • 8 replies
  • 0 views

Team,

We have a requirement where we need to show difference of two rows in third row in paging grid. Like below , any suggestion?

Third column should show difference of row 2 minus 1st row of Column A.

id A B
1 10 F
2 20 F
Difference 10

    8 replies

    mikes0011
    Brainy
    August 24, 2022

    What is the source of your data?  Is it something static, or something with a variable number of rows?  Whether this functionality is even possible at all, depends very strongly on these details which you haven't provided.

    The Expression Guru
    August 24, 2022

    source of data is data subset and it will not change,

    mikes0011
    Brainy
    August 24, 2022

    DataSubset is not the "source", but just how you have the local data stored.  "Source" means where the data is originally coming from (unless it's just hardcoded static values in a local variable, in which case you should clarify).

    The Expression Guru
    stefanhelzle0001
    Brainy
    August 24, 2022

    This example form includes your use case

    mikes0011
    Brainy
    August 24, 2022

    yes, though if it matters, this example is an editable grid (where the calculations are easy to do on a row-by-row and column-by-column basis), not a paging / read-only grid, where if we're going to do a similar thing, we need to assemble all the data up-front (or some other workaround).

    The Expression Guru
    stefanhelzle0001
    Brainy
    August 24, 2022

    True, but this depends on the number of rows needed. For two + 1 rows, that approach should be fine.