Use case
You have a table with the date and the amount and need to show the amount increase by 4% from month to month.
Solution
- Switch the page to the edit mode.
- Insert the Table Transformer macro and paste the table with the start date and the start amount.
- Select the macro and click Edit.
- In the Presets tab select Custom transformation and click Next.
Enter the following SQL query:
SET @cnt = 0; SET @date = (SELECT T1.'Date' FROM T1); SET @amount = (SELECT T1.'Amount' FROM T1); WHILE @cnt < 11 BEGIN SET @cnt = @cnt + 1; SET @date = DATEADD(month, 1, @date); SET @amount = @amount * 1.04; INSERT INTO T1 (T1.'Date', T1.'Amount') VALUES (@date, @amount); END; SELECT * FROM T1
- Click Next.
- Define the date format .
Save the macro and the page.