Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
+1
person also asked this
people also asked this
Replies
9 replies
Subscribers
5 subscribers
Views
8793 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Reports
Report with a variable number of columns
Kyle Jorgensen
over 7 years ago
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
0
georgeu
over 7 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
georgeu
over 7 years ago
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.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data