4 Replies Latest reply on Aug 17, 2016 5:27 PM by Shinichiro Murakami

# Basic Calculation returning blank field, any ideas how to fix this?

Hi There,

I am building a dashboard where the viewer can select a time period (Day, Week, Month) and then see based on the period what the DoD, WoW or MoM % difference is for the dynamically chosen metric.

I have build calculated metrics for all the relevant time periods, and now am trying create the % difference metric using:

Example - ([Pageviews Last Month] / [Pageviews Previous Month])-1

The end result is as follows:

Metric
Pageviews Last Month1,245,253
Pageviews Previous Month1,367,858
Pageviews MoM%

The calculation I have used for the individual metrics such as Pageviews Last Month is as follows:

THEN [pageviews]

ELSE NULL

END

In my mind, if these Metrics return a value the calculation should work.

Any ideas? I'm completely lost.

• ###### 1. Re: Basic Calculation returning blank field, any ideas how to fix this?

Try this .

sum([Pageviews Last Month]) / sum([Pageviews Previous Month]))-1

You will see red pill with this change, then you can put this field into the calculation area again.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: Basic Calculation returning blank field, any ideas how to fix this?

Thanks Shin,

I just got it to work using this:

SUM([Pageviews Last Month])/ AVG({FIXED:SUM([Pageviews Previous Month])})-1

Cheers

1 of 1 people found this helpful
• ###### 3. Re: Basic Calculation returning blank field, any ideas how to fix this?

The reason behind is that each month's level calculation is always "null" in this case.

Then aggregation of each month result is also Null.

So, only the way to pull right answer is sum all value for "[Pageviews Last Month]" and "[Pageviews Previous Month]" across the time range.

Then get delta of two.

That is the meaning of new formula

Thanks,

Shn

1 of 1 people found this helpful
• ###### 4. Re: Basic Calculation returning blank field, any ideas how to fix this?

You are welcome.

Could you mark y answer as correct for community people to know it's answered.

Thanks,

Shin