5 Replies Latest reply on Dec 6, 2016 4:41 AM by Norbert Maijoor

# Calculation using PREVIOUS_VALUE(0)

Hi people!

I can't understand what is going on with my results. I created a calculated field using this formula SUM([TV GRP])+(PREVIOUS_VALUE(0)/1.43)

As you can see in my first image below the calculation it is working for the first column (date by hour) but then doesn't work and I don't now why.

As you can see in my second image below where I'm aggregating date by day the calculation stops after a gap.

I suppose that the formula stops the calculation when there is no value. If this is true, how can I solve it?

• ###### 1. Re: Calculation using PREVIOUS_VALUE(0)

Fabio,

Nut sure of it's supports your final solution requested but find my approach as reference below and stored in attached workbook version 9.3

a. TV GRP 0:  zn([TV GRP])

b. Formula 2:  SUM([TV GRP 0])+(PREVIOUS_VALUE(0)/1.43)

1 of 1 people found this helpful
• ###### 2. Re: Calculation using PREVIOUS_VALUE(0)

Hi Norbert!

Worked well!

But there is an issue using 3 different data sources connected ( relationship).

I still trying to understand what is going on.

• ###### 3. Re: Calculation using PREVIOUS_VALUE(0)

Hi Fabio,

• ###### 4. Re: Calculation using PREVIOUS_VALUE(0)

Hi Norbert

Unfortunately no, its a project for a customer.

But let me explain and maybe you can give me some insights.

1-I'm using a Google Analytics live connection and 2 excel files.

2-First, I created a calculated field in all my 3 sources to provide a Date+Hour dimension using this calculation DATEADD('hour',[Hour],[Date] ).

3-Second, I created a relationship between them using this new dimension Date+Hour.

The Problem:

I noted that when crossing Radio and Google Analytics trying to see a relation between Radio GRP and Sessions using the Date+Hour field of Radio source, the GRP looks OK but several gaps appear for the measure SESSIONS. Its the same for the other way, when I use my Date+Hour field of the Google Analytics source, the Sessions looks OK but several gaps appear for the Radio GRP.

My conclusion is that both sources don't contain all Date+Hour necessary to relate all data.

I'm planning to create a file from the scratch only containing all date+hour for the entire year and after that, connect the 3 sources in this new file.

What do you think?