Skip to main content
Known Participant
Nov 26, 2021 9:34 AM UTC
Question

How to implement it in interface using grid?

Hi Team,

Can anyone please help me how can I implement the case given below in interface using grid:

Col A Count Col B
a 1
a 2
a 1
Total a 4
b 1
b 2
Total b 3

It should display the count of col A for each category. Any other suggestions might be helpful. 

    4 replies

    tanvirs0003
    Inspiring
    Nov 26, 2021 12:53 PM UTC

    Create a rule using Query Aggregation to get the count of each column. Then use the rule as data source for readonly grid

    Known Participant
    Nov 26, 2021 5:25 PM UTC

    Okay, But how to insert Total after each set of rows. If possible could you please explain more and share the code snippet, it would be really helpful.

    richardm900458
    Inspiring
    Nov 29, 2021 10:17 AM UTC
    Participating Frequently
    Nov 30, 2021 9:09 AM UTC

    Hi Shubham,

    I agree with others, you can create an internal CDT (not mapped to any table) with the required fields.

    Create an expression rule and map you required data using two variables - one retrieving the data (a and b) and the other retrieving the aggregate data (Total a, Total b).

    Then map your required data in the internal CDT with a!forEach()

    In the interface map a local variable with the Expression Rule and use this local variable as data in grid.

    Regards,

    Farnaz