2 Replies Latest reply on May 26, 2020 6:24 AM by Fred Burdine

# Need help comparing two types of dates correctly (Tableau 2020.1)

Hello,

I'm new to Tableau and my boss has handed me one of her workbooks which has a fairly manual uploading process that I believe can be managed completely in Tableau.

What we're looking for is a way to see how many subscribers we gain and lose each month, knowing these figures also gives us our total count of subscribers and our churn rate (loss rate). Currently, my boss has set up a few worksheets to give us our Created and Cancelled figures, then uses those figures to update an excel sheet for the total and loss rates. With that excel sheet, she has it connected to visualize our loss rate and provide an average over time.

What I'd like to do is have all of the calculations recorded in the excel file run in Tableau and then keep all of the connections internal. I've built fixed LODs for our created and cancelled figures which are calculating well on their own but when I try to make a calculation of [created]-[cancelled] to find the net change by month the figures blow up and the output is meaningless. Can you please help me understand how to fix this issue?

• ###### 1. Re: Need help comparing two types of dates correctly (Tableau 2020.1)

You'll want to perform some aggregation within your calculated field:

```SUM([{f} Subs Created by month year])-SUM([{f} Subs Cancelled by month year])
```

If you don't aggregate then this will be a row-level calculation. It will compute for every row in the data, then sum up the results afterward. In the case of simple arithmetic, that will often produce the same results, but these calculated fields, because of the LODs, are not quite simple arithmetic. Thus, summing within the calculated field should fix the problem.

• ###### 2. Re: Need help comparing two types of dates correctly (Tableau 2020.1)

Thanks Ken! This is getting me a lot closer, though the final answer I was expecting was 878.

I should have been more clear, my overall goal is to make a chart that looks like the excel file in my original post called CHURN RATE.

So it would have the created amounts, cancelled amounts, and the difference for each month by month and in total aggregate.

The issue above was the first obstacle I couldn't get over in creating the above goal. Do you have any more advice on how I can proceed?