G
grep
I'm trying to calculate a person's payment balance for a series of
events. I figured that what I could do is sum the prices for all the
events, and the payments made for all the events. Something like this:
sum([Price])-sum([Payments])
This works fine, as long as you make a single payment per event. The
problem is that once you throw a second payment into the mix,
Sum([price]) adds the original price back.
In other words: EventA costs $300. I make a payment of $150 for EventA,
and my calculation comes out to a balance of $150, which is correct. I
then add a second payment of $150, to cover the balance. Now I'm
screwed: Sum([Price]) now = $600 from which I'm now subtracting
Sum([Payments]), which is $300. My balance should be $0, but it's now $300.
So how do I get it to only use the price value once per event?
grep
events. I figured that what I could do is sum the prices for all the
events, and the payments made for all the events. Something like this:
sum([Price])-sum([Payments])
This works fine, as long as you make a single payment per event. The
problem is that once you throw a second payment into the mix,
Sum([price]) adds the original price back.
In other words: EventA costs $300. I make a payment of $150 for EventA,
and my calculation comes out to a balance of $150, which is correct. I
then add a second payment of $150, to cover the balance. Now I'm
screwed: Sum([Price]) now = $600 from which I'm now subtracting
Sum([Payments]), which is $300. My balance should be $0, but it's now $300.
So how do I get it to only use the price value once per event?
grep