I have been looking at queries on and off for a while now, and keep running into this same problem. I want a query of GL transactions that includes the project ID field. When exporting, the sum of the amounts should be zero, but it isn't.
This is what I am doing. Query starting with "Account", the criteria is date for this fiscal year, and select on fund. Output is all columns similar to when I look in NXT account screen, but excluding project columns. When I export to Excel, it will balance to zero so long as I exclude unposted transactions.
BUT, when I add project IDs to the output for the query and export, it doesn't balance to zero. Reviewing the rows, I can see duplicate rows. Even if I remove the duplicate rows, it still does not balance to zero. I think it has to do with how it is picking up transactions that have a split on them. I filtered down to one split transaction in the export, and compared it to how it looks in the GL account in NXT, and the amounts are different. It seems to be picking up the amount before the split on the export.
Has anyone else experienced this? How can I get a full detail GL listing with project ids?