Chapter 6 [ 225 ] Example: <ROW("Total Vehicles", "Model Year") This example will place members from the Total Vehicles and Model Year dimensions into the report output as row members. • PAGE Syntax: <PAGE(comma separated dimension list) Example: <PAGE (Market) This example will place members from the Market dimension into the report output as page members. Data range commands The data range commands are a good example of the limitations in data selection we mentioned earlier. As of this writing, there are only three commands available to you. After you look at the coding examples, you will see why we spoke of limitations. BOTTOM Syntax: <BOTTOM ([<rowgroupDimension>,]<rows>, <column>) Example: <BOTTOM (100, @DATACOL(2)) With the BOTTOM command, the returned data is sorted in descending order by the data values and the bottom number of rows, as specied by parameter two for the column specied in parameter three is returned. In the example, the bottom 100 rows of data would be sorted according to the values in data column number two. The TOP command is identical, but returns the top number of rows specied. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Using your Essbase Cube [ 226 ] Data ordering command Yes, it says data ordering command because there is only one command. Although this command has a name similar to a command used in relational databases, the difference, and to some a limitation, is that the data returned by the Essbase report script is ordered by data value columns only. Columns that contain metadata or member names, cannot be sorted using this command, since only columns containing numeric data values are considered for ordering. ORDERBY Syntax: <ORDERBY ( [<rowgroupDimension>,] <column> [<direction>]{,<column> [<direction>]}) Example: <ORDERBY (Sales, @DATACOL(1) DESC) This example will sort the rows of data returned with the member name of Sales on data column one in descending order (data value order): Member selection and sorting commands To compensate for the limitations we mentioned previously, Essbase provides us with several dozen member selection and sorting commands. You have already seen many of these commands in the previous chapter on calculation scripts and they perform the same functions. The only difference is that the syntax for the report script commands is different than it is for the calculation and member formula commands. Here are a few examples so you can get the idea. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Chapter 6 [ 227 ] CHILDREN Syntax: <CHILDREN mbrName Example: <CHILDREN "Calendar Periods" This example will return data rows for all children of the Calendar Periods member, but no data for the Calendar Periods member itself. Notice we said member when Calendar Periods is actually a dimension too. We did this to show you that in this command, you can enter any member name that has its own children and want only to return its children. Keep in mind that Essbase will do exactly as you instruct it to do. When you say to return the children of the Calendar Periods dimension, you will get the Quarter values. Other dimensions not mentioned will be at the highest level unless specied. ICHILDREN Syntax: <ICHILDREN mbrName Example: <ICHILDREN "Calendar Periods" This example will return data rows for all of the children of the Calendar Periods member and for the Calendar Periods member itself. Notice that here too we said member when Calendar Periods is actually a dimension as well. We did this to show you that in this command, you can enter any member name that has its own children and want to return those children and their parent. Format commands The format commands tell Essbase how your report output will look. Unless otherwise specied in the command itself, these commands can be used multiple times in a script, and will only affect the rows of data returned by other commands that are written after the format commands in the script. There are many more of these formatting commands available to you. Some have almost overlapping abilities, so they can be somewhat confusing. If you are using your report script to extract data for a at le, you will not need too many of these formatting commands. If you are trying to create really fancy looking reports, you will need plenty of practice and patience. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Using your Essbase Cube [ 228 ] SUPCOMMAS Syntax: { SUPCOMMAS } Example: { SUPCOMMAS } This example will return numeric data rows with no commas delineating the numbers for values over 999. COMMAS Syntax: { COMMAS } Example: { COMMAS } This example will return numeric data rows with commas delineating the numbers for values over 999. WIDTH Syntax: { WIDTH number [ column1 [ column2 [ columnN ] ] ] } Example: { WIDTH 20 } This example will truncate all column widths to 20 spaces wide, regardless of their actual width. Column or row calculation While these are some pretty cool commands, we recommend that you be very careful with their use. As you must know by now, we have repeatedly stated the benets of Essbase's dynamic data calculating abilities and there is no arguing that. When you use these row and column calculation commands, you are articially creating data that does not actually exist in the Essbase database. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Chapter 6 [ 229 ] We say to be cautious because if there is ever a question about the report script generated data, it will not always be the easiest to track down or debug. Again, nice functionality, but use it very carefully. All calculation commands must be enclosed in curly braces as shown. CALCULATE COLUMN Syntax: {CALCULATE COLUMN "newColumn" = expression } Example: {CALCULATE COLUMN "Actual YTD" = 1 + 2} This example will create a new column called Actual YTD which will be the sum across of columns 1 and 2. Again, if the Actual YTD value does not exist in Essbase, it may be difcult to debug the data displayed on the report, unless you are intimately familiar with the report script itself. ONCOLCALCS Syntax: { ONCOLCALCS } Example: { ONCOLCALCS } This command must be used in the script prior to coding the CALCULATE COLUMN command to turn on the column's calculating ability. OFFCOLCALCS Syntax: { OFFCOLCALCS } Example: { OFFCOLCALCS } This command must be used in the script after coding the CALCULATE COLUMN command to turn off the column's calculating ability. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com . numbers for values over 99 9. COMMAS Syntax: { COMMAS } Example: { COMMAS } This example will return numeric data rows with commas delineating the numbers for values over 99 9. WIDTH Syntax: { WIDTH. the Essbase database. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 20 09 8601 ave. p #1, , lubbock, , 794 23 Download at Boykma.Com Chapter 6 [ 2 29 ] We. is licensed for the sole use by Paul Corcorran on 5th July 20 09 8601 ave. p #1, , lubbock, , 794 23 Download at Boykma.Com Using your Essbase Cube [ 226 ] Data ordering command Yes, it says data