Ralph, If you are willing to change the display to show the most recent months first (choosing descending order for the column based on the datefield per month), you could do the following:
You would need a separate variable per union group, and in the following example I am showing variables for only two union groups. Let's say that your row field is {table.uniongrp}, and that you have a set of 6 union groups, but groups B and E are only counted quarterly, while the others are counted monthly. Your crosstab would be set up with {table.uniongrp} as the rowfield, and {table.date} as the column->group options->descending order->print for each month. We'll say that the summary field is count of {table.ID}. Select the summary in an inner cell->right click->format field->common tab->suppress->x+2 and enter:
whileprintingrecords;
numbervar cntB;
numbervar cntE;
if gridrowcolumnvalue("table.uniongrp") = "B" and
remainder(month(gridrowcolumnvalue("table.date")),3) = 0 then
cntB := currentfieldvalue;
if gridrowcolumnvalue("table.uniongrp") = "E" and
remainder(month(gridrowcolumnvalue("table.date")),3) = 0 then
cntE := currentfieldvalue;
false
Then in the same screen go to display string->x+2 and enter:
whileprintingrecords;
numbervar cntB;
numbervar cntE;
if gridrowcolumnvalue("table.uniongrp") = "B" then
totext(cntB) else
if gridrowcolumnvalue("table.uniongrp") = "E" then
totext(cntE) else
totext(currentfieldvalue)
When using gridrowcolumnvalue, use the field that represents the row or column in the crosstab, and replace the curly brackets with "".
The above only works for descending month order. If you have to use ascending order, then you would need to create a manual crosstab, where you group on {table.uniongrp} and then use formulas like:
//{@Jan}:
if {table.uniongrp} in ["B","E"] and
datepart("q",{table.date}) = 1 then 1 else
if not({table.uniongrp} in ["B","E"]) and
datepart("m",{table.date}) = 1 then 1 else 0
//{@Feb}:
if {table.uniongrp} in ["B","E"] and
datepart("q",{table.date}) = 1 then 1 else
if not({table.uniongrp} in ["B","E"]) and
datepart("m",{table.date}) = 2 then 1 else 0
//{@Mar}:
if {table.uniongrp} in ["B","E"] and
datepart("q",{table.date}) = 1 then 1 else
if not({table.uniongrp} in ["B","E"]) and
datepart("m",{table.date}) = 3 then 1 else 0
Then you would insert sums on these formulas and suppress the detail sections.
-LB