Hi, thanks for that, changing picture to value makes it all work fine. In answer to your first question, the column across_varis defined as an across variable so the actual columns of the resulting table will be similar to this group_var (y z x) (y z x) where i only have 2 distinct values for across_var, for 3 distinct values of across_var i would have 10 columns total group_var (y z x) (y z x) (y z x) For anyone’s future reference here is a version of the code that works. data _test_data; across_var='Value1'; do x=0.001 to 0.501 by 0.05; n+1; group_var='Group'||n; y='test1'; z='test2'; output; end; n=0; across_var='Value2'; do x=0.301 to 0.701 by 0.05; n+1; group_var='Group'||n; y='test3'; z='test4'; output; end; run; proc format; value hextraffic low-<0='style=[background=white]' 0-<0.1='style=[background=cxF7977A]' 0.1-<0.2='style=[background=cxF9AD81]' 0.2-<0.3='style=[background=cxFDC68A]' 0.3-<0.4='style=[background=cxFFF79A]' 0.4-<0.5='style=[background=cxC4DF9B]' 0.5-<0.6='style=[background=cxA2D39C]' 0.6-high='style=[background=cx82CA9D]' other='style=[background=white]' ; run; title 'Correct Output'; proc report data=_test_data; columns group_var across_var,(y z x); define group_var / group 'Group' 'Variable'; define across_var / across ''; define y / 'other' 'col1'; define z / 'other' 'col2'; define x / 'colour' 'key'; compute x; call define('_c2_','style',put(_c4_,hextraffic.)); call define('_c3_','style',put(_c4_,hextraffic.)); call define('_c4_','style',put(_c4_,hextraffic.)); call define('_c5_','style',put(_c7_,hextraffic.)); call define('_c6_','style',put(_c7_,hextraffic.)); call define('_c7_','style',put(_c7_,hextraffic.)); endcomp; run; title;
... View more