This article provides two videos to show the detailed steps to complete the community report customization for Connections 4.0 Metrics, you can find them from the attachment list of this article.
Here are the main steps described in the video, for your reference.
Create a customized report with Cognos Report Studio
- Open a browser and navigate to the Cognos dashboard using the following address: http://cognosserver.example.com:9083/cognos/servlet/dispatch/ext
- Log in to Cognos as the Cognos administrator.
- Create a new folder 'CustomReport' under folder 'IBMConnectionsMetrics' to save the new customized report that will be created.
- Click Launch > Report Studio, then select the package 'Metrics' to open Report Studio.
- Select to create a blank report.
- In the 'toolbox' panel, drag and drop 'Chart' to the report, then select chart type in the pop up window.
- Find the query name of this chart in the 'Properties' window, and open the query to add data items.
- Add data item 'App' to the query and edit the expression, for all available functions that can be used, refer to the 'Functions' panel on the expression window.
- Add data item 'Number of visits' to the query and edit the expression.
- Add data item 'Date' to the query and edit the expression.
- Add slicer to the query to only show the data for certain community.
- Go to reprot edit page, set data item 'Number of visits' to y-axis, 'Date' to x-axis and 'App' to series.
- Edit the char size for better look.
- Click 'Run' button on the toolbar box , input parameters to test the report.
- Go back to Report Studio, and add another chart with defferent type to the report by the same way.
- Save the report to the 'CustomReport' folder.
- Date item 'Date' (In video 00:03:10)
This data item is used to return the date points that selected from the Metrics UI date scope drop down. Just copy and use it will be ok.
The expression is:
lastPeriods(?upnum? , ancestor (#'[METRICS_TRX_CUBE].[DATE].[DATE].[DAY]->:[PC].[@MEMBER].['+ prompt('endDate' , 'integer') +']'#, #prompt('uplevel' , 'integer')# ) )
The 'lastPeriods(integer_expression , member )' is a Cognos dimensional function, this function returns the set of members from the same level that ends with "member".
The 'ancestor(member, integer)' is a Cognos dimensional function, this function returns the ancestor of "member" at "integer" number of levels above "member".
The '#' is Cognos macro expression label, which indicate the string surrounded by '#' is a macro expression and should be executed.
The 'prompt(name , type)' is a Cognos macro function to get the input from user.
The '?' also indicates the string surrounded by it is a input parameter from user. But this is not a macro function.
So this expression will receive the input parameter 'upnum', 'uplevel' and 'endDate', and calculate the date points need to show on the chart.
- Slicer (In video 00:03:40)
This slicer is a filter that will return the community by community id. Slicers will be applied to all calculations in the query. Just copy and use it will be ok.
The expression is:
filter([METRICS_TRX_CUBE].[COMMUNITY].[COMMUNITY].[COMMUNITY NAME] , [METRICS_TRX_CUBE].[COMMUNITY].[COMMUNITY].[COMMUNITY NAME].[COMMUNITY NAME - Category Code]=?dcommunityid?)
The 'filter ( set_expression , Boolean_expression )' is a Cognos dimensional function that returns the set resulting from filtering a specified set based on the Boolean condition. Each member is included in the result if and only if the corresponding value of "Boolean_expression" is true.
The '[METRICS_TRX_CUBE].[COMMUNITY].[COMMUNITY].[COMMUNITY NAME]' is the member set of all communities.
So this expression nest all communities, and returns the community which's id equals parameter 'dcommunityid'.
Add the customized report to the Community report list
- Find the 'jobtemplate1' under folder Public Folders > IBMConnectionsMetrics > Metrics > static on Cognos dashboard.
- Add the customized report to the job list.
- Open Metrics page for a community to see the current page layout.
- Edit the 'reports-config.xml' to add the customized report to the UI.
- Refresh the community Metrics page, the new report link will appear.
- Click 'Update Metrics' to refresh the reports of this community.
- Wait for the report refresh complete, then fresh the page and click the new report link to see the report.
- Customized report label (In video 00:01:41)
This label is a string key that should be in below file:
Sample path: \IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\lwpvm220Cell01\Metrics.ear\lc.metrics.ui.jar\com\ibm\connections\metrics\ui\strings\ui.properties
In the video, just simply used the existing string as the report link label to do a demo, in the real case, you should add new string to this file and restart the application to take effect.