Hi there everyone,
I was just wondering if there is a simple way to perform a DateDiff function in MAQL. More specifically I want to be able to count number of days between Order Date and Today. I will be using Order Status to determine whether the order was completed and this MAQL metric would help me in highlighting those that take too long.
Thanks a lot,
Best answer by Joseph Heun
Date arithmetic is generally fairly simple using MAQL. However, this all depends on how you have your model set up in relation to the objects you are trying to use in your report.
One simple way of achieving this may look something like the following:
`SELECT THIS - Date (Order Date) BY Order Status`