Creating a History Cube

Options

I have a temp cube which calculates an average usage over a dynamic rolling period. This is recalculated daily.

For reporting purposes, I now need to write this entry into a history cube by day, so that I can trend the results.

 

The temp cube is dimensioned purely by "device code" which is the entity it is calculating the average for.

The history cube will need to be dimensioned by "device code" and "day".

 

As it stands, I tried writing a procedure which flags "Today" and then writes the entry into today's date. This works, however it just seems to keep the entry for today..... there is no entry for yesterday. I have not got a "Clear cube" in the procedure.

 

Please assist.

Tagged:

Answers

  • Paul Wyatt
    Paul Wyatt Customer
    First Comment 5 Up Votes 5 Likes First Anniversary
    edited March 2020
    Options

    Hi Kelly,

     

    I am firstly assuming that:

     

    1. Steps to calculate moving average have been carried out separately.
    2. Moving Average values have been stored in the temp cube.
    3. Temp cube values need to be transferred to the target cube against the correct devices and date of capture?

     

    Does your procedure first select the current day dynamically before writing the contents of the temp cube to your target cube?  If not, you would be writing the new values over the top of all values and across all dates.

     

    If what I've described is true, I am guessing that you you would need to select the date against which you wanted to store the temp values in the target cube.  Using a procedure, your process could look like this, where measures is the target cube:

     

    image

     

    A breakdown of the above 2 step procedure could then be as follows:

     

    1. Selection

    image

     

    2.  Data flow 

       Block a.   Temp cube: 1D - Device

       Block b.   Target cube: 2D - Day, Device

       Dataflow: Target cube = a

     

     

    HTH

     

    Kind regards,

     

    Paul Wyatt

  • Kelly Goldsworthy
    Options

    Hi Paul,

     

    Thanks for that. Your initial assumptions were correct, and you are correct in the fact that I hadnt selected the day prior to writing to the cube - hence why it was overwriting each time.

    Ill add the dynamic date select and see what happens.

     

    Thanks a million!

     

    Kind regards,

    Kelly