Net change of facebook followers in 30 day period

Welcome to Dojo

Net change of facebook followers in 30 day period

I am trying to make a calculated field which determines the net change in facebook followers in the last 30 days. The data has columns: 

Date: November 04, 2018 1:00:00 AM
Total Page Fans: 262
How can I determine the number of fans 30 days ago, and yesterday and output the difference for my card? I am very amateur at this logic so please try to be descriptive!
Black Belt

Re: Net change of facebook followers in 30 day period

I tried to step through this logic in an ETL for you.  I think that some of this is more complicated in ETL vs MySQL, but here goes.




There are four main steps.


Step 1: Assign a value for the date you want to compare to.  In your case, you mentioned 30 days prior and 1 day prior.  In ETL I used the "Date Operations Tile" to create two new fields, Date-30 and Date-1.



Step 2:  You need to join these dates to your original data set and then remove the duplicate (Date_1) field.




Step 3: Lookup the number of fans from 30 days ago and join that to your data.



Step 4:  Repeat step 3, but for one day ago.



Finish the ETL by attaching an output data set tile and naming your new data set.  


This will give you a data set with the following schema:




Good luck to you.  Let me know if you have questions.

“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
Looking for the latest Community solutions? Please visit our accepted solutions board here!