Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a facts table containing balances per day, configured as start and end. The fact table looks like this:
Load
Dimension,
Day,
Start/End,
Balance,
TimeStamp
FROM xx;
What I want to do is compare the end balance to the start balance each day to get a difference. The problem I have is that for each day, there might be several start or end balances. So, the user is allowed to filter on the balance timestamp to select the "correct" one. The problem I have is that I need the TimeStamp filter to separate on Start/End, so if I filter on a timestamp where Start/End = 'end', the start balance shouldn't be affected and vice versa.
The only solution I found to this is to split the fact table into two based on the start/end dimension, store balance and timestamp as StartBalance/EndBalance and StartTime/EndTime and then link them through a composite key of Dimension and Day. Then I can create two separate filters for the timestamp that does not affect each other.
This does not feel like the best solution, and I was wondering if there is a way to create the same without splitting the fact table and then linking/joining.
See attached for two examples. So: