Start a new topic
Answered

Find Filter - Yesterday

I'm using a find filer like below


test{MM}{dd}.csv


How can I tel the days portion to be 1 day in the past? 


If it's on the forums already I apologize.


Thanks!


Best Answer

That doesn't work if the current day is the first of the month.


To be safe, for all scenarios:


UserVariable:

yesterday_ms  =    {add_start:-86400000}{now}{add_end}

my_date_info   =   {rparse_start:MMdd}{yesterday_ms}{rparse_end}



So then {my_date_info} will have the MMdd as its value, but for yesterday since we subtracted 86400000 milliseconds from the current time right now.


{math_start  can't be used when dealing with such large numbers unfortunately due to a bug in he math library we use and large numbers.


My apologies I found it test{MM}{math_start}{dd}-1{math_end}.csv


Maybe this can help someone else :)

Answer

That doesn't work if the current day is the first of the month.


To be safe, for all scenarios:


UserVariable:

yesterday_ms  =    {add_start:-86400000}{now}{add_end}

my_date_info   =   {rparse_start:MMdd}{yesterday_ms}{rparse_end}



So then {my_date_info} will have the MMdd as its value, but for yesterday since we subtracted 86400000 milliseconds from the current time right now.


{math_start  can't be used when dealing with such large numbers unfortunately due to a bug in he math library we use and large numbers.

Ben,


Thanks so much for clarification!  


I'm somewhat new to Crush... could you point me at where I would configure my UserVariable then I can reference my_date_info?


Thanks!

In the task flow, add a task item called UserVariable.  It then lets you have multiple rows of variables where it processes them in order, so you can do part of a calculation then on t the next line do more, etc.

Ben,


Worked perfectly thanks kindly!

Login to post a comment