stack overflow(please help!)
Posted: Sat Feb 11, 2017 5:01 am
Hi, guys
I know usually when we have long feeder chain, it is possible to have this stack overflow issue. My current problem is we forecast next 3-4 years at day level and using rolling average way for forecasting. E.g. to forecast day1, we need to go back 60 days actual to do average. And day2 is using day1 forecast plus last 59 days actual's average. And so on so forth until next 4 years. We usually have around 1000 - 1300 days to go forward with average forecasting.
In the date dim, I create my own date key to move backwards or forwards. Rather than using next, previous attributes, it will simply use day +/- n to move around in the rule. The code I am using is like that,
Forecast dayN avg = Actual or Forecast (dayN-1 + dayN-2+ ... + dayN-60) / 60;
Feeders;
Actual or Forecast avg=> Forecast dayN+1,
Forecast dayN+2,
....,
Forecast dayN+60;
Although the rule is long, but still logical. However, whatever I tried, it always hitting this stack overflow issue as well as cube view is very slow when there are many forecast days to show because the feeder chain is too long and deep. I know we have to break it to make it work and fast. However, I can't think of how to break it. Is that when I create this date key, I make every half year blank? So that the feeder can't continue due to blank for example , at day180, the key is blank. And then what? How to bridge the gap? Because whenever the feeder's calculation comes to day180, it will point to blank. At this stage, I know need to something like
Forecast avg day179=> Forecast ATTRS(dim, day179, 'Next');
But in this formula's left side, how do I know that forecast avg is at day179? We can't use any IF or conditions to locate day179's value. The right side is fine. Do I need to create some hierarchies in the date dim to have specific relative date based on current forecast date under day179 parent so that I can use it in the rule?
Please give me advice if any of these thought is wrong. I am really stuck in this implementation.
I know usually when we have long feeder chain, it is possible to have this stack overflow issue. My current problem is we forecast next 3-4 years at day level and using rolling average way for forecasting. E.g. to forecast day1, we need to go back 60 days actual to do average. And day2 is using day1 forecast plus last 59 days actual's average. And so on so forth until next 4 years. We usually have around 1000 - 1300 days to go forward with average forecasting.
In the date dim, I create my own date key to move backwards or forwards. Rather than using next, previous attributes, it will simply use day +/- n to move around in the rule. The code I am using is like that,
Forecast dayN avg = Actual or Forecast (dayN-1 + dayN-2+ ... + dayN-60) / 60;
Feeders;
Actual or Forecast avg=> Forecast dayN+1,
Forecast dayN+2,
....,
Forecast dayN+60;
Although the rule is long, but still logical. However, whatever I tried, it always hitting this stack overflow issue as well as cube view is very slow when there are many forecast days to show because the feeder chain is too long and deep. I know we have to break it to make it work and fast. However, I can't think of how to break it. Is that when I create this date key, I make every half year blank? So that the feeder can't continue due to blank for example , at day180, the key is blank. And then what? How to bridge the gap? Because whenever the feeder's calculation comes to day180, it will point to blank. At this stage, I know need to something like
Forecast avg day179=> Forecast ATTRS(dim, day179, 'Next');
But in this formula's left side, how do I know that forecast avg is at day179? We can't use any IF or conditions to locate day179's value. The right side is fine. Do I need to create some hierarchies in the date dim to have specific relative date based on current forecast date under day179 parent so that I can use it in the rule?
Please give me advice if any of these thought is wrong. I am really stuck in this implementation.