40
Views
14
Comments
Sub total or grouping

Hello Everyone,

I have 2 entities, Invoices and Customer, Invoice has the foreign key of Customer,

I want some kind of this display like attached in excel file, can someone help me out with this, it might be called grouping or it has other name I dont know.

I hope you all can  understand my question :)

Grouping.xlsx
2025-01-09 14-56-57
IQ78

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Query_Data/Calculate_Values_from_Grouped_Data

UserImage.jpg
Dev Limbachia

Thank You SIr,

But this is not my Expected output. For Instance,

this is my data, Now i want some changes like this..

Now in this S1 should only show Customer name and total amount beside

and when i click on S1, then it should expand and show the customer names with their respective amount,


for example, (i'm taking some examples for explanation)


Sales person Name              Customer Name             Pending amount

              S1                                          C1                                        10

              S1                                          C1                                        20

              S1                                          C2                                        15

              S2                                          C3                                        25

              S2                                          C4                                        30

              S2                                          C4                                        40

 this is my table now i want like this

Sales person Name              Customer Name             Pending amount

              S1                                          C1                                        30

              S1                                          C2                                        15

              S2                                          C3                                        25

              S2                                          C4                                        70


Now, when i click on the First S1 Line, then it should expand and show both Values like this,

Sales person Name              Customer Name             Pending amount

              S1                                          C1                                        10

              S1                                          C1                                        20

              S1                                          C2                                        15

              S2                                          C3                                        25

              S2                                          C4                                        70

 I hope you have Understood my question

UserImage.jpg
Preetam Vaidya

Hi @Dev Limbachia : In this scenario you have to first use groupby to group the person and then use aggregated function 'count' to get the final count. 


Thanks,

Preetam Vaidya

UserImage.jpg
Dev Limbachia

Hello Preetam, 

I've mentioned my query in detail can you go through that please?

Thank you.

2025-01-09 14-56-57
IQ78

hI, Isn't this better:

Yours seems anti pattern - mixing up aggregate and details.

Use the master detail pattern UI for the right track.

For your convenience, i put the OML.

regards


MasterDetail.oml
UserImage.jpg
Dev Limbachia

Thank you Indra,

I'm thankful for your helping hand, but i got a new addition in this, i.e.

Sales person Name              Customer Name             Pending amount

              S1                                          C1                                        10

              S1                                          C1                                        20

              S1                                          C2                                        15

              S2                                          C3                                        25

              S2                                          C4                                        30

              S2                                          C4                                        40

if this is my table, then it should be something like this,

Sales person Name         Pending amount

              S1                                   45

              S2                                   95 

and then after, i will get this, when i click on S1

Sales person Name              Customer Name             Pending amount

              S1                                          C1                                        30

              S1                                          C2                                        15

              S2                                          C3                                        25

              S2                                          C4                                        70

 and further more, sorry for the earlier explanation but i also got this update few minutes ago :(

2025-01-09 14-56-57
IQ78

it is weird:

 S1                                   30

              S1                                   45

              S2                                   95 

S1 is group by sales, cust, but S2 not. I think this is wrong.

You need to modify the query and all being right.

regards

2025-01-09 14-56-57
IQ78

Hi, u edited?

UserImage.jpg
Dev Limbachia

yes i edited

UserImage.jpg
Dev Limbachia


this is what i updated

2025-01-09 14-56-57
IQ78

Change the query:

this is group only by sales person Name. ANd:

this is group by sales person and customer. But the last is weird also, click S1, but S2 comes up also.

regards

UserImage.jpg
Dev Limbachia

No No, i just wrote that for explanation purpose, if i click on S1 then only S1 will expand or come up not S2, Similarly when i click on S2 then it will expand.

But is it possible to use Master detail, as it shows only 2 divisions or sections but i want 3.


2025-01-09 14-56-57
IQ78

just put another table below the existing one and associates it with different queries :

2025-01-09 14-56-57
IQ78

MasterDetail2.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.