Changing the Query Used by an Analytics Report
You can customize that query that is used to populate an analytics report with data.
Before you begin
You must have Use application, Use analytics, and Develop app permissions and have a thorough understanding of XML and SDL LiveContent Reach skin development. See "Customizing Skins" in the SDL LiveContent Reach User Guide for more information. Additionally, if your modifications extend beyond changing a report title, report grouping, or chart type, you should be knowledgeable about HTML, CSS, JavaScript, XQuery, and XSL technologies.
About this task
When a report is activated, SDL LiveContent Reach runs a query to gather the analytic data into an XML model. The query that is used is defined by the <query> element in the configuration, which defines the XQuery file to load from the skin, and the $function variable to pass to the XQuery file.
<query file="your_queries.xql" function="MostViewedMedia"/>
Line Chart: each series represents a line and each point is a date within that data set. The point (
nameattribute andxattribute) should be a date, and theyattribute should be the value of the point.The following is a typical structure returned by the query:<result> <series name="Name of Series"> <point name="" x="" y=""/> ... </series> ... </result>- Pie and Bar Chart: there is only one series and each point represents a slice of data. In a bar or pie chart, the
nameattribute should be the label for the data point, andyattribute should be the value of the point.The following is a typical structure returned by the query:<result> <series name="Name of Series"> <point name="Label 1" y=""/> ... </series> </result>