Skip to main content

Date calculations have always been hard for me. I think because I am not sure when to use DATEPART and DATETRUNC. I think in this case I want to use DATETRUNC and my calc should look like this:

 

DATETRUNC('month',[Trans_Date])>=DATETRUNC('month',Today())-18

 

I am looking for advice here but also advice in how to best approach date calculations in general.

 

Thank you,

 

Scott

답변 3개
  1. 2020년 11월 10일 오후 4:24

    Hi @Scott Carman​ -

    If I understood you correctly, you started in the right direction.

    • If you are going to filter it in your Viz, you can use DATEDIFF('month',[Transaction_Date],TODAY())<=18. Drop it to filter and select true.
    • If you are going to use a data source filter
      • Select Relative date range

    Hi @Scott Carman​ -If I understood you correctly, you started in the right direction.If you are going to filter it in your Viz, you can use DATEDIFF('month',[Transaction_Date],TODAY())<=18.

0/9000