Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have about 35 fields in a concatenated table (bills and positions).
Does it make sense to add a group by statement if I don't need all of the single positions per bill (only the sum(amount) ? Or is there a better way to get handle this?
I'm thinking about this because of a performance issue, processing is quite slow.
Thanks for your ideas.
Regards Aloah
Hi Aloah,
I think you ansered your question yourself. The group by statement seems very useful in your case.
Only select the 2 fields that you need and make a group by clausule as follows:
Bills:
LOAD Billnr,
sum(amount)
RESIDENT Bills // Note that this option is for either source system suitable
Group by Billnr;
STORE * FROM Bills INTO Bills.qvd;
Hi,
thanks for your reply. My problem is that I need more than two (in fact about 30 fields) from the tables.
In this case I'm having group by statement with 30 fields. Does that make sense?
Regards
Aloah
it does work however, i dont know whether it is the best way to do it.
I think if you group by multiple fields you have to keep in mind that all the fields have to keep fixed values in each row.
I have these tables.
%Pos_id
%Pos_number
%Pos_Article
......
Pos.Amount
%Pos_Article is linked to the article tables.
Every position has severals positionnumbers with different articles. Group by doesn't make sense as long as the articles and pos_numbers are in there.
If I use sum (Pos.Amount) and group by %Pos_id, %Pos_number, %Pos_Article.... the result will be (almost) the same as without group by.
I think I'll have to kick out the position numbers and articles? Am I right?
Thanks