The data in each cell can be raw values, if it works out that only one row from the data table populates the cell. Here is an example:
Names Default To Here( 1 );
dt = New Table( "School Report",
New Column( "Name", character ),
New Column( "Class", character ),
New Column( "Semester", character ),
New Column( "Test", modeling type( ordinal ) ),
New Column( "Score" )
);
nameList={"Jim","Nancy","Edward"};
classList={"Math","Science","Civics","History","Phys Ed"};
semesterList={"Fall","Spring","Summer"};
testList={1,2,3,4,5};
For Each( {Name}, nameList,
For Each( {Class}, classList,
For Each( {Semester}, semesterList,
For Each( {Test}, testList,
dt << add rows(1);
dt:Name[nrows(dt)] = Name;
dt:Class[nrows(dt)] = Class;
dt:Semester[nrows(dt)] = Semester;
dt:Test[nrows(dt)] = Test;
dt:Score[nrows(dt)] = Random Integer( 70,100);
)
)
)
);
dt << Tabulate(
Change Item Label( Statistics( Sum, "Score" ) ),
Remove Column Label( Analysis Columns( Score ) ),
Add Table(
Column Table(
Grouping Columns( :Semester, :Test ),
Analysis Columns( :Score )
),
Row Table( Grouping Columns( :Name, :Class ) )
)
);
Jim