07-07-2018 03:49 PM
I have to create group by average column in cross tab(AVerage_Sales) in SAS VA 7.3 :-
Can you guys please provide any input on this.
I have tried AVG[_GroupBY_] option it is not working and giving some absurd value.
The data granularity is on date from which month has been calculated.
07-09-2018 02:24 PM
The problem is that you can't assign a fixed scope for the aggregation, so when you show the Agent column, you are getting the 'average' value for each Manager-Agent combination (i.e. that agent's sales).
There is a new feature in the latest Viya versions that allows the scope of the aggregation to be manipulated, but at 7.3 I think you might be able to get what you want with a hierarchy. If you define a hierarchy on Manager->Agent, then your crosstab will have dynamically-expanding rows. When Agent is collapsed, you will see the average sales for the manager's agents. When the Agent is expanded, the Average Sales will show 'wrong' in the rows, but the subtotal for the Average Sales should be the what you want.
If you don't need the total sales for the manager, you could just change the aggregation type of 'Sales' to be 'Average' and you get the same effect with a single item.