Conditional File Outputs

In some cases, you may want to conditionally separate data in distinct output files. I did not find a perfect way to handle that, it would have required some complex scripting, and I wanted to avoid that.

However, there is a way to do that in Fuzible.

Let me show you an exemple :

You have a company running different agencies and you want to build an Excel reporting for each one but with a single query.

The idea is to make use of already existing functions :

  • “Rows/file” setting
  • “Append existing file” option
  • Scripted file output
The Excel Target settings Panel
The query, retrieving data from a database. I’m using a scripted output : [id_group] will be replaced by the value of each row from the “sample_table_1” table.

The SQL table has 100 rows, with 10 different “id_group” values. Fuzible will create one file / row (as expected), but will also append existing ones. It means that it will create as many file as there are different “id_group” values, and append those when an incoming row matches with the pattern :

10 files have been created.
The content of the “MyGroupReporting_000.xlsx” file