Fill in pivot table's empty join records with zeros
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 09:36 AM - edited 06-30-2023 09:54 AM
I'm using a pivot table against a database view that uses a left join. As intended I get records from the parent table even if not matched in the join. When I create a pivot table report for this view, the field I'm summing on shows empty cells instead of zeros.
I would like the pivot report itself to fill in these empty sums with zeros. Or if not possible, apply the equivalent of an 'isnull()' mechanism on the empty numeric fields due to the left join. To reiterate, I do not want to filter out the missing record values, I want the resulting displayed sum to show as zeros instead of empty.
The screenshot that is showing zeros is to show what I'd like to achieve, but it's an artificial sample because I'm inserting dummy data into the joined table just to convey what I'm looking to achieve. Inserting artificial records won't be an option in real life.
The screenshot with the yellow highlights shows the empty (missing because of left join) cells I would like to display as zeros.
Seems a fairly basic reporting task. Any suggestions on how this might be accomplished? Thanks in advance for any advice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 07:11 AM
In case it helps anyone, I've found an approach to filling in empty values in a database view with zeros.
- Add a read-only/invisible field in all parent joined tables with a default value of zero.
- Add a glidefunction:coalesce() functions to view's data dictionary that coalesce all amount fields.
The view then produces a pivot like the following.
I added glidefunction:coalesce() functions to my view's data dictionary. The trick was to add a default zero-valued field in the parent(s)