I am trying to write a report that is based on two queries: Forms and Audit.
The Forms query returns a list of all forms that have been completed on our system. The Audit query returns a list of users who have edited the forms and the edit date.
My aim is to create a webi report that lists all forms completed and then the latest user to have edited each form (displayed in one table).
The dimensions in each query are as follows:
Forms:
- FormNo
- ClientNo
- ClientName
- FormCompletionDate
- FormCreator
Audit:
- AuditID
- FormNo
- AuditDate
- AuditUser
- AuditRole
(note: I have used a query filter to restrict the results to just a particular type of AuditRole).
I have merged the two FormNo dimensions.
My desired report will have:
- Forms.FormNo
- Forms.ClientNo
- Forms.ClientName
- Forms.FormCompletionDate
- Forms.FormCreator
- Max(Audit.AuditID) i.e.the most recent AuditID
- The Audit.AuditUser associated with the above max(Audit.AuditID) i.e. the most recent user to edit the form
Not all forms will have an associated entry in the Audit query results. In such cases, I will still need the form to be listed but without a maximum AuditID and AuditUser.
I have been able to create a Detail variable that returns the maximum AuditID if there is one. However, I have tried many ways to pull through the associated AuditUser for that AuditID, but am continuously creating either #MULTIVALUE or #CONTEXT errors (or worse, an error that prevents that results from showing at all, forcing me to view just the structure of the report).
Any help at this point would be very much appreciated!