Report with a variable number of columns

What would be the best approach to create a report with a variable number of columns?

I am creating a report that aggregates project cost data by customer and division that can be filtered by certain project attributes. I can create a DB view with a variable number of columns, but I'm not sure if Appian data types support a variable number of fields.

I've attached a mockup of what the base data looks like and what the report I am looking to create looks like.

OriginalPostID-258734



  Discussion posts and replies are publicly visible

Parents
  • Like Christine mentioned, we have used a variable number of columns to display a variable number of vendors. Each vendor had multiple rows in the database for different categories, but all vendors that were to be displayed together had the same categories. This is similar to “Project Divisions” in your example. a!gridField was used to create a grid. The “columns” parameter had two values. The first value was a!gridTextColum, which displayed all of the categories. The second value was a!applyComponents, which was used to create a column for each index in an array of CDTs. These columns were our own rule that displayed each value from the CDT in their own row. Because of the way our data was set up, the rule that called a!gridField queried for the relevant vendor names and categories only. The rule used to display each column (the one called by a!applyComponents) had its own query to populate all the category data for that specific vendor. It is important that all of your queries sort by the same field (Project Divisions in your case), otherwise the values in each column will not match up to the correct row.
Reply
  • Like Christine mentioned, we have used a variable number of columns to display a variable number of vendors. Each vendor had multiple rows in the database for different categories, but all vendors that were to be displayed together had the same categories. This is similar to “Project Divisions” in your example. a!gridField was used to create a grid. The “columns” parameter had two values. The first value was a!gridTextColum, which displayed all of the categories. The second value was a!applyComponents, which was used to create a column for each index in an array of CDTs. These columns were our own rule that displayed each value from the CDT in their own row. Because of the way our data was set up, the rule that called a!gridField queried for the relevant vendor names and categories only. The rule used to display each column (the one called by a!applyComponents) had its own query to populate all the category data for that specific vendor. It is important that all of your queries sort by the same field (Project Divisions in your case), otherwise the values in each column will not match up to the correct row.
Children
No Data