Monday 24 August 2015

Query Based Reports and Cardinality

I would like to draw your attention towards a very simple yet important fact about query based reports which we create on the fly in Maximo. All of us are aware that running an adhoc report from any Maximo appication, requires an Report Object Structure and user will only see the ROS he/she has access to. 

I came across an error once while running one adhoc report from Incident application which actually prompted me to look towards this end. My clients asked me to show one report to list out all the closed incidents with the cause and resolution fields. So, I simply opened the Incidents application, selected all the closed incidents and clicked on Create Report button and selected Summary report in Style tab. In the Select tab of Query Based Report dialog window. I select the required fields from main INCIDENT object, long description text (LDTEXT) from FR1CODE object labeling it as Cause and also selected  long description text (LDTEXT) from FR2CODE object labeling it as Resolution. I was shown a warning message as below:
"BMXAA7325W: The fields you have selected contain multiple relationships, therefore the report style will be changed to a Detail format to support these fields. Any defined groups will be cleared. Click OK to continue, or click Cancel to cancel the field selection."

The list report that got displayed had Resolution fields in separate section below the Incident record(s) fields. As per QBR and Reporting in Maximo, during the report creation process, the category relations are evaluated to determine if there are single or multiple relationships with the main object. Any number of categories with Single Relationships can be added to the QBR. However, when categories have Multiple Relationships, different business rules are invoked. If the user has selected a Summary report, only 1 Category with a Multiple Cardinality can be included. If the user tries to select fields from multiple categories with 1:N relationships, he will be given the choice to either change his style type to Detail, or to remove the field selection. 

I had to go check the object structure for this one. There was the INCIDENT object as parent object. FR1CODE and FR2CODE were list as child object(s) to INCIDENT object. I could see that for both these objects, parent object was INCIDENT, object order was 1 and relationship(s) were also correct, but the cardinality was 'UNDEFINED'. The cardinality value usually defaults to UNDEFINED, which assumes a multiple relationship (one to many or 1:N). Always try to select the relationship type that is applicable. In this case it should have been SINGLE. 

I hope this helps someone.

No comments:

Post a Comment