I'm not even sure the best way to title this question, but I'm a bit stumped on how to resolve this. I am trying to build a grid that groups similar data (in this case, quantity, value, rate) and sum a value (accrual). The current rub is that I need to group the data in such a way that as long as the dimensions match, then we sum up the row. As soon as any of the dimensions change, however, a new group by row needs to be be created. Hopefully my examples will better describe how this should work.
Here is the following raw data. In this case, the accrual is an expression that's calculated (Value * (Rate/100)) / 360
Ideally the data should look something similar to this:
|Start Date||End Date||# Days||Quantity||Value||Rate||Total Accrual||Avg Daily Accrual|
Here is what I was able to get working - I've set up my dimensions for Quantity, Value, and Rate. Start Date and End date are just expressions which return the min/max of the Date field above, # of days is a count(date), and total/daily accruals are expressions which sum and sum/count the accrual calculated field.
|Start Date||End Date||# Days||Quantity||Value||Rate||Total Accrual||Daily Accrual|
I'm looking for any tips or functions I could use to "divide/break" the grouping of data sequentially based upon date and whenever the quantity/value/rate changes compared to the record(s) before it. I've looked into the help for the above/below function, but I haven't been able to get it working my case. If I have to, I can probably work up some script that does all of this looping, but it feels like this is something Qlikview should be able to do.
Any help would be greatly appreciated - even pointers to the correct function would be great.
Thanks in advance, let me know if I can further clarify anything.