Use case

You have a table with dates. You need to get a dynamic result table where dates are newer than today date.

Solution

  1. Switch the page to the edit mode.
  2. Insert the Table Transformer macro and paste the table or the macros outputting tables within the macro body.
  3. Select the macro and click Edit.
  4. In the Presets tab select Custom transformation and click Next.
  5. Enter the following SQL query:

    SELECT *
    FROM T1 
    WHERE T1.'Date' > "today"
    SQL
  6. Save the macro and the page.


The "today" variable is also recognized by SQL functions operating with dates (for example, FORMATDATE, DATEDIFF, etc.), can be combined with other variables within the same query and successfully used in more complex SQL queries.

Use case with a more complex SQL

You have a table with dates. You need to get a dynamic result table with interval (number of days) between each date and today date.

Solution

  1. Switch the page to the edit mode.
  2. Insert the Table Transformer macro and paste the table or the macros outputting tables within the macro body.
  3. Select the macro and click Edit.
  4. In the Presets tab select Custom transformation and click Next.
  5. Enter the following SQL query:

    SELECT T1.'Date',
    FORMATDATE("today") AS 'Today',
    DATEDIFF(day, "today", T1.'Date') AS 'Date Difference from Today'
    FROM T1 
    SQL
  6. Save the macro and the page.