Skip to content

Reporting- send a report for a range of dates

2 min read · Updated 4 Nov 2026

This article provides step-by-step instructions for sending a report that includes multiple sheets and applying a filter that selects a range of dates.



  • Create a string variable.

    Variable panel with the name vFetchDateRange, type String, a truncated SQL value starting with select listagg, and a More button.

  • Click on the More button, change the type to SQL
    For Snowflake, Paste this code :

    select listagg(base_date,'|') as datelist from (select to_char(current_date() - row_number() over(order by 0),'YYYY-MM-DD') base_date from table(generator(rowcount => 7)))

    For Databricks, Paste this code:

    select concat_ws('|',collect_list(date_format(base_date,'yyyy-MM-dd')))from(select explode(sequence(current_date()-7, current_date()-1, INTERVAL 1 DAY)) base_date)

    databricks emoji

  • This code generates a list of the last 7 days, starting from yesterday.
    This code can be changed to generate any list of dates or any other date part.
    The result of the code is a string like this:
    ​2024-06-17|2024-06-16|2024-06-15|2024-06-14|2024-06-13|2024-06-12|2024-06-11
    The variable should look something like this:
    ​

    Define your variable dialog with SQL query selected and the Snowflake listagg query that builds the list of dates.

  • Enter the Action section in the workbook editor

  • Add a report block to the canvas, and give the report a name

    Report block with its name field set to My Report and an empty body.

  • Add a loop action inside the report

    Report block named My Report containing a For each date in loop block with an empty list slot and an empty Do section.

  • Add a split text and an action that will call the variable defined in the previous step.
    ​

    For each date loop whose list is split text of Execute SQL vFetchDateRange by the | separator to list.

  • Add an append action on the date field to filter.
    The filter is completed, and the action below adds a date from the list we fetch to the field filters on each iteration.

    Inside the loop, an Append to filter block on Vw Predefind Periods Flags, Order Date New, with the date value as Applied.

  • Add a snapshot of the sheets you want to include in the report
    ​

    Report lastSevenDays with the For each Item loop, then Go to Sales Dashboard and Go to Charts Drilling, each followed by Add sheet screenshot to report.

Calling the report can be done via a button or via schedule in the Astrato lobby.

  • Calling the report via a button.

    • Add a button to the screen.

    • Add an action to call the report using the button.
      ​

      When Button emits On click, Open report lastSevenDays, with Use applied filters True, Max resolution 1700, DPI factor 1 and Report parameters.

    • Or Add an action to send the report.
      ​

      When Button emits On click, Send report lastSevenDays to an email list, with file name, subject, email body, password, filters, resolution and DPI options.

  • To test the report generation, preview the app a click on the button.