Skip to main content
Susan Clark が「#Tableau Prep」で質問

Hi everyone,

 

I'm trying to replicate some existing flows from Alteryx into Tableau Prep and automate as much as possible.

 

In one of the flows I need to 'locate' the first date/piece of data available, for each month.

 

I'm still learning how to write the calculated fields and not aware of all functions available in Tableau Prep.

 

Firstly, I was wondering if this is possible?

And secondly, if anyone is able to steer me in the right direction how to achieve this please?

 

My team was previously going through the data manually to locate the 1st piece of data (the date will be different each month), once we know the date a calculation as follows was used/modified in Alteryx:

 

DateTimeDay([lastExecutionDate]) = 3

 

Is there a calculation or a function that can automatically locate the minimum date, for each month, thus eliminating the manual hunt?

 

Thank you in advance for your help.

5 件の回答
  1. 2023年4月14日 15:37

    Good day Susan,

     

    Ah, I typically manually type it into "Create Calculated Field". I did forget that in Prep you can't have a self referencing field. However you can get around it by creating a separate calculated field that gives first date of the month:

     

    // First of the month

    DATETRUNC('month',[theDate])

     

    and then referencing it in the LOD calc:

    // first data day

    {fixed [First of the month]: MIN([theDate])}

     

    Does that help?

     

    Best regards,

     

    -Dan

0/9000