Sum grouped by a value

2 posts, 0 answers
  1. Luka
    Luka avatar
    2 posts
    Member since:
    Oct 2016

    Posted 08 Nov Link to this post

    Hi, 

    I have a table like this 

    name             category     quantity

    apple                 fruit            3

    banana              fruit            4 

    broccoli         vegetable       2

    oats               cereals          40 

    chicken            meat            9

    spinaches     vegetable       9 

    I want to have a total based on category, like this:

    fruit              7

    vegetables   11

    cereals         40

    meats            9

     

    Now I'm doing it with IIF, but I have dozens of categories.

     

     

     

  2. Katia
    Admin
    Katia avatar
    308 posts

    Posted 08 Nov Link to this post

    Hi Luka,

    Aggregation of values by a category can be achieved with Table/CrossTab item where the data can be aggregated by adding data field as a row/column grouping expression.

    To create row/column groups for the Table/CrossTab you can use Table/Crosstab WizardThe structure of the created CrossTab can be explored in Group Explorer in extended mode where you can also add child/parent groups and modify the current structure if needed.


    Regards,
    Katia
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top