I have a problem that I'm struggling with and I hope I could get some help here. I have attached a demo qvw file.
Let's say I have two tables: Table_Volume and Table_Static.
They look like this before my problem exists:
I need the Volume in Table_Volume to use the FreeVolume if he has (FreeVolume-VolumeUsed) but it must be done in the right order (by Id)
So If I illustrate the first row in Table_Volume: Volume is 30000 and check the first row in Table_Static where User is 111 and I see the User got FreeVolume (FreeVolume-VolumeUsed is not 0).
So I need to update VolumeUsed to 10000 because Volume is more than he got left, but the User got another FreeVolume that he can use. So I need to update VolumeUsed there aswell.
On the other table Table_Volume I also need to create two columns with calculated values. You can see the user uses all of his freevolume in the first record and I need to calculate how much of each record is free.
These two tables would in the end look like this. (As you can see the starttime have to match between ValidFrom and ValidTo) IntervalMatch?
I hope you can help with this.