Skip to Content

XSDS - Aggregate

Hello Everyone

I am using XSDS to select data from a CDS table. I am using $aggregate function, in which I am trying to send a Column based on the input. I tried with few options and tried to get info online. Did some one worked on this? and have a handy solution on how to pass a column name dynamically to the aggregate function?

Thanks for sharing your responses.



Add comment
10|10000 characters needed characters exceeded

  • What issues do you have? the $aggregate function receives an object to which you can add the column names which should be considered for the aggregation.

    Maybe you can share your code or describe the error you get to become a better support.

  • Thanks Sergio and Florian. I could resolve the issue, I have passed an object to the $aggregate function.

    Thanks for your suggestions.



  • Get RSS Feed

1 Answer

  • Nov 09, 2016 at 07:26 PM


    agree with Florian, in your $aggregate function, you can pass an object like

    // table.$query().$where(oYourConditions).$aggregate(oYourColumns).$execute();

    the variable/object oYourColumns would be like { COLNAME: true, COLNAME2: true }; // replace COLNAME/COLNAME2 with your actual column name from the table. You may have one or more of these columns in the object you are passing into the aggregation clause.

    here is the API documentation - I hope this helps. Let us know if you run into other issues and good luck!

    my advise to make sure your code is running correctly would be to write a sql query on the sql console, then your xsds code to validate you did the correct XSDS syntax.

    Add comment
    10|10000 characters needed characters exceeded