Skip to Content

SAP hana View exclude aggregation

i have 2 rows

1 john smith 10 objects

2 john smith 10 objects

i need to group by last name but only show 10 in objects. this has to be done in aggregation or using SQl..

what i see is

john smith 20 objects

i wanna see

john smith 10 objects.

any ideas?>

i am on the latest SAP hana

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 27, 2020 at 07:01 AM

    Hi Amer,

    If I understand your question, you can DISTINCT CLAUSE to get what you need. Refer below sample code.

    DO BEGIN
    IT_T = SELECT 'JOHN SMITH' as NAME, 10 as OBJECTS from dummy 
    UNION ALL
    SELECT 'JOHN SMITH' as NAME, 10 as OBJECTS from dummy 
    ;
    
    SELECT DISTINCT NAME, OBJECTS FROM :IT_T;
    END

    If this satisfy your requorement, please accept.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 10, 2020 at 03:00 PM

    is it possible to do this in the graphical view as all my work is in graphical view and wil require for me to create SQl views and graphical views to go back and forth.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.