Hi,
I have a page where I was displaying a simple table of resource rating results for all engagement groups. I was asked to add breakout values for each engagement group (FG-AM-3, FG-AM-5, and FG-AM-6). I had separate Table Transformers so I had 4 separate tables. I want to merge the code so I have one Transformer macro producing a single table with 4 data rows. Note that for brevity, the code below is just for the total and one group. Final solution will have additional code to display results for 2 more groups.
The first SELECT statement below before UNION ALL works perfectly by itself. The second SELECT statement after UNION all also works perfectly by itself. Together, I get the Cannot read properties error noted in subject.
Based on similar posts in this forum, I think the problem is with the presence or absence of the "T1." prefix on some fields. I think I've tried every combination, but still get the error. Please suggest how I can resolve this. Also open to different approach.
/* Display total resources rated and resource satisfaction percentage:
(Meets + Exceeds Count / Total Rated Count) */
SELECT
FORMATWIKI("{cell:width=300px|align=center|font-size=50px|font-weight=bold}",
"All", "{cell}")
AS 'Engagement Group',
/* Display total count of engagements */
FORMATWIKI("{cell:width=300px|align=center|font-size=50px|font-weight=bold}",
(SELECT COUNT(DISTINCT(T1.'Engagement')) FROM T1), "{cell}")
AS 'Total Engagements',
FORMATWIKI("{cell:width=300px|align=center|font-size=50px|font-weight=bold}",
COUNT('No Rating') + COUNT('Meets') + COUNT('Exceeds') + COUNT('Does Not Meet'), "{cell}")
AS 'Total Resources Reviewed',
FORMATWIKI("{cell:width=300px|align=center|font-size=50px|font-weight=bold}",
COUNT('No Rating'), "{cell}")
AS 'Total Resources Not Rated',
FORMATWIKI("{cell:width=300px|align=center|font-size=50px|font-weight=bold}",
COUNT('Meets') + COUNT('Exceeds') + COUNT('Does Not Meet'), "{cell}")
AS 'Total Resources Rated',
FORMATWIKI("{cell:width=300px|align=center|font-size=50px|font-weight=bold}",
ROUND((COUNT('Meets') + COUNT('Exceeds')) / (COUNT('Does Not Meet') + COUNT('Meets') + COUNT('Exceeds')) * 100) + "%", "{cell}")
AS 'Total Resource Satisfaction % (Meets or Exceeds Expectations)'
FROM T1
UNION ALL
/* Display FG-AM-3 total resources rated and resource satisfaction percentage:
(Meets + Exceeds Count / Total Rated Count) */
SELECT
FORMATWIKI("{cell:width=300px|align=center|font-size=30px|font-weight=bold}",
"FG-AM-3", "{cell}")
AS 'Engagement Group',
/* Display total count of engagements */
FORMATWIKI("{cell:width=300px|align=center|font-size=30px|font-weight=bold}",
(SELECT COUNT(DISTINCT(T1.'Engagement')) FROM T1 WHERE T1.'Engagement Department' LIKE "FG-AM-3%"), "{cell}")
AS 'Total Engagements',
FORMATWIKI("{cell:width=300px|align=center|font-size=30px|font-weight=bold}",
COUNT('No Rating') + COUNT('Meets') + COUNT('Exceeds') + COUNT('Does Not Meet'), "{cell}")
AS 'Total Resources Reviewed',
FORMATWIKI("{cell:width=300px|align=center|font-size=30px|font-weight=bold}",
COUNT('No Rating'), "{cell}")
AS 'Total Resources Not Rated',
FORMATWIKI("{cell:width=300px|align=center|font-size=30px|font-weight=bold}",
COUNT('Meets') + COUNT('Exceeds') + COUNT('Does Not Meet'), "{cell}")
AS 'Total Resources Rated',
FORMATWIKI("{cell:width=300px|align=center|font-size=30px|font-weight=bold}",
ROUND((COUNT('Meets') + COUNT('Exceeds')) / (COUNT('Does Not Meet') + COUNT('Meets') + COUNT('Exceeds')) * 100) + "%", "{cell}")
AS 'Total Resource Satisfaction % (Meets or Exceeds Expectations)'
FROM T1
WHERE T1.'Engagement Department' LIKE "FG-AM-3%"