Use case

You need visualize the numbers representing progression in a table.

Solution

  1. Switch the page to the edit mode.
  2. Insert the Table Transformer macro and paste the table within the macro body.
  3. Select the macro and click Edit.
  4. Switch to the SQL query tab.
  5. Enter the following SQL query:

    SET @maxProgress = (SELECT FORMATNUMBER(40) FROM T1); 
    /* set the number representing the 100% progression in this variable
    or use MAX('Your Column Name') instead of the FORMATNUMBER() function to determine the value */
    
    SELECT *, FORMATWIKI("{cell:background-image: linear-gradient(to right, #4caf50, #4caf50);
    background-repeat: no-repeat;background-size:"+ 'Progress Bar' +" 50%;background-position-y: 50%;}", 
    'Progress Bar', "{cell}") AS 'Progress Bar' FROM 
    (SELECT *, T1.'Progress'/@maxProgress * 100 + "%" AS 'Progress Bar' FROM T1);
    SQL
  6. Click Next.
  7. Save the macro and the page.