Forum Discussion

Mohamed_HannanS's avatar
Mohamed_HannanS
Qrew Trainee
6 years ago

Select distinct on multiple columns and then sum

Hi ,
 I have a requirement where i need to find the distinct on column A and B for  the related column c and then count. 

 For eg :
Input :
C         A         B
123     abcd   2 
123     abcd   3
123     abcd   2
234     xede   1

Expected Report: 

C        A         B
123     abcd   5
234     xede   1


  • Hi Mohamed,

    Have you tried building this out using a summary report yet? Summary reports do allow you to pick how your data is grouped and could be built to show you a summary of data based on that grouping. For example:

    Store       Rep       # of Sales
    Store 1    Rep 1    2
    Store 1    Rep 1    3
    Store 2    Rep 1    2
    Store 1    Rep 2    1

    Could be come:

    Store        Rep      # of Sales
    Store 1   Rep 1     5
                   Rep 2     1
    Store 2   Rep 1      2

    You would just want to set the summary report to work off of the fields you want to report against. I hope that suggestion is helpful.