Use case
You have a table with two columns: Target date and Completion date. You need to compare and rate these dates:
- If the completion date is within 5 days, the status is ON TIME.
- If the completion date is more than 5 days late, but less than 10 days, the status is LATE.
- If the completion date is more than 10 days, the status is VERY LATE.
Solution
- Switch the page to the edit mode.
- Insert the Table Transformer macro and paste the tables or the macros outputting tables within the macro body.
- Select the macro and click Edit.
- In the Presets tab select Custom transformation and click Next.
Enter the following SQL query:
SELECT *, CASE WHEN (('Completion date' - 'Target date') / "24h") < 5 THEN "ON TIME" WHEN (('Completion date' - 'Target date') / "24h") > 5 AND (('Completion date' - 'Target date') / "24h") <= 10 THEN "LATE" ELSE "VERY LATE" END AS 'Rating' FROM T1
- Click Next.
- Define the date format .
- Save the macro and the page.
You can use FORMATWIKI function to insert statuses into a table.