Calculating Day over Day % Change

Hello,

I am building a report with date on my x axis and ads on my Y axis.
the body contains a daily count of a measure and I’d like to calculate the percent change from day to day, but I am having difficulty building this variable. report looks like row below.

date	date	date
xyz	10	5	10

I have read a lot about current date and relevant date function but can’t get it to work properly. I have tried to build out layers of variables, such as Yesterday’s count and 2 days ago count and then combine these in a variable to calculate the % Change.
Any help is greatly appreciated.

Thank you.

[Moderator Edit: Added code formatting - Andreas]


bseef (BOB member since 2015-10-28)

What do you exactly want?

A.
Date Value %change
1 10 -
2 11 +10%
3 10 - 9%
5 12 +20%
7 11 -8%

or B.
Date Value %change
1 10 -
2 11 +10%
3 10 0%
5 12 +20%
7 11 +10%

or C.
Date Value %change
1 10 -
2 11 +10%
3 10 -9%
5 12 - (because there is no value for the previous day)
7 11 - (because there is no value for the previous day)

or D. (C like B)?

Day on day change simplest (like in A.) would be

%change=[Value] / Previous([Value];1)-1

PS. I always create a table first which exactly does what I need, then convert to a graph.


MBLM :netherlands: (BOB member since 2014-01-31)

Hey MBLM,

Thanks for the reply!

Scenario A is what I was looking for and that formula worked perfectly!
I apologize for such a simple request, but I’m more comfortable with tableau, however, getting more business objects work thrown at me. I’m dealing with daily data, so there shouldn’t be a gap in dates.

Thanks again for your help, it’s much appreciated!!


bseef (BOB member since 2015-10-28)