Grouping of the data in functions can be done as shown

Example:

To group data byCATEGORYSHOW SUM(SALES, DISCOUNT) ACROSS CATEGORY

ACROSS CATEGORYis used to group byCATEEGORY

To group data based onYEARSSHOW SUM(SALES, DISCOUNT) IN 2011,2012, 2013, 2014

IN 2011,2012, 2013, 2014is used to group byYEARS