Running Total and slow query

ikzouhetnietweten

Registered User.
Local time
Today, 22:51
Joined
Oct 23, 2015
Messages
44
I created an expression in the query Mut2 called: RunTot
Its supposed to be a running total.. but its not working.
And above that , the query is super slow because of that.
First field has to be the date, from old to new.
Any idea how I can make the runningtotal, and a fast query?

RunTot: DSum("[inuit]";"[Mutaties]";"[inuit]>=" & [inuit])
 

Attachments

Last edited:
I see no inuit field in Mutaties
 
I corrected it now. the query is super slow. (for example, click on the filter of Date..)

And the Runtotal doesnt make any sense, its all the same. It should be going up with the field ' inuit'. So if inuit is 1 the runtotal should go up +1. And if inuit is -1 the runtotal should be total -1 etc.
so Runtotal should be like 1 2 3 4 5 6 from the top.
The first field has to be the Date, from old to new.
 

Attachments

Last edited:
Code:
RunTot: DSum("[inuit]","[Mut2]","[inuit]>=" & [inuit])

You can't have your running total looking into the same query it is in. Your DSUM needs to look into another datasource (table or query).

Also, you don't have a running sum, you have a weird total for all inuit values greater than the current one. To achieve a running sum you need a way to order your data and it must be different than the field you are summing. So putting inuit in both the field to sum (first argument) and using it solely in the criteria argument makes no sense.

Perhaps we start from scratch and you tell me what you are trying to achieve. If you could demonstrate with data that would be best. Give me 2 sets of data:

A. Starting sample data. Give me a few dozen records from Mutaities. Include enough sample data to show all cases.

B. Expected data. Based on A, show me what you expect your query to produce in terms of data
 

Users who are viewing this thread

Back
Top Bottom