1

I have 2 TFDQuery objects connected to 2 different databases from which I'm fetching tuples and merging them into a single TFDMemTable. This works fine, but now I need to group those merged tuples and create certain aggregate fields.

For example, FDQuery1 and FDQuery2 having tuples of the following structure:

Country | UserName | BillCount | BillAmount | BillDiscount

I need to group them having aggregate fields like this:

Country | UserName | sum(BillCount) | sum(BillAmount) | sum(BillDiscount)

How to do this with FireDAC?

Victoria
  • 7,822
  • 2
  • 21
  • 44
AEC
  • 29
  • 3
  • You can add [Aggregates](http://docwiki.embarcadero.com/Libraries/en/FireDAC.Comp.DataSet.TFDDataSet.Aggregates), to them then set grouping index. – Victoria Aug 06 '18 at 12:56
  • Thank you victoria for the response. I am extremely new to FD, it would be really helpful if you could show that with the above example. I went through the web but i am not able to understand the usage. – AEC Aug 08 '18 at 17:38

0 Answers0