Would you be able to post the workbook (twbx file)? I was able to recreate it in Sample Store and everything seems to be working correctly.
Sure here is a sample workbook. This workbook has the field names shortened. The funny thing is I can get this year's time period.
BTW The PeriodRange field would be dragged to the Filters shelf.
GetLastYearDateRange.twb.zip 16.1 KB
You attached a workbook (.twb), not a packaged workbook, so the data is not included in the workbook. You can go to the File->Export Packaged Workbook... to create a packaged workbook you can post.
Thanks for letting me know. Here you go! I've been trying to debug, I think the problem is in the LYPeriodRange field, but the logic should be correct.
GetLastYearDateRange.twbx.zip 28.1 KB
There are two issues that I see in what you posted, though I'm not clear on what your desired goal is, so I could be wrong.
The LYEndDate calc uses the following formula:
IF [TransactionDate] = [AsOfDate] Then
This leads it to return Null for every row except where the Transaction Date = As of Date, and I believe what you want is more something like:
Since LYBeginDate is based on LYEndDate, the calc that you laid out also returns mostly Null. Changing the calc now returns values that the LYDateRange comparison can use. However, that calc:
if [TransactionDate] <= [LYEndDate]
and [TransactionDate] >= [LYBeginDate]
then 1 else 0
Is looking at the current transaction date to compare to last year's end date and begin date. I'm not sure of the logic of this, would you be wanting to use the SameDateLastYear value instead of Transaction Date?