Skip to main content
Solved

Rule for max date

  • March 14, 2024
  • 1 reply
  • 105 views

aysel_jafarzade
Data Pioneer
Forum|alt.badge.img

Hello,

I'd like to set up a rule for the 'transaction_date' column to verify if the latest date in the column equals to previous work day. How can I do this? Is there any function for that?  If there isn’t , we also have an additional calendar table where  previous work day indicated for each date. But how can I indicate another table inside a rule?

Thanks in advance.

Best answer by ivan.kozlov

Hello @aysel_jafarzade,

I suppose you could try using aggregation rules for this purpose - this way you’ll be able to take advantage of the maximum() function that would identify the latest date in the dataset for you.
For the purpose of aggregation you could pick either some specific aggregation key or create a variable that would be used as a sort of artificial key that would allow you to aggregate all the records in the dataset and then look for maximum value.
In my case i used “key” string value as aggregation key so all the records are aggregated together.

Here’s an example of rule implementation:

The condition i have uses a couple date functions:
maximum(date) != dateAdd(today(),-1,"DAY")

You can read this condition as “maximum/latest date value is not equal to current day - 1 day.
Here are examples where today() would mean 18th of March.

 

Please try to follow the example i shared and build your version of such rule. I hope this would be helpful.

View original
Did this topic help you find an answer to your question?

1 reply

ivan.kozlov
Ataccamer
Forum|alt.badge.img+3
  • Ataccamer
  • 29 replies
  • Answer
  • March 18, 2024

Hello @aysel_jafarzade,

I suppose you could try using aggregation rules for this purpose - this way you’ll be able to take advantage of the maximum() function that would identify the latest date in the dataset for you.
For the purpose of aggregation you could pick either some specific aggregation key or create a variable that would be used as a sort of artificial key that would allow you to aggregate all the records in the dataset and then look for maximum value.
In my case i used “key” string value as aggregation key so all the records are aggregated together.

Here’s an example of rule implementation:

The condition i have uses a couple date functions:
maximum(date) != dateAdd(today(),-1,"DAY")

You can read this condition as “maximum/latest date value is not equal to current day - 1 day.
Here are examples where today() would mean 18th of March.

 

Please try to follow the example i shared and build your version of such rule. I hope this would be helpful.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings