EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB11030: How to build a report that displays only the last order for each customer in MicroStrategy Developer 9.x and 10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


Specific requirement to display the last order date with each customer.

Customers generally have numerous orders and details associated with each order. A common request is to have a report that will show only the last order date associated with each customer. The following steps will provide a general outline how to achieve this.
 
STEPS:

  • Create the attributes and metrics associated with each customer's order (Customer, Item, Day, Revenue).
  • Create two new additional metrics with their definitions, as follows:
    Max(Day) at Report Level
    Level: Report
    Condition: Nothing
    Transformation: Nothing
ka02R000000kaD6QAI_0EM440000002Fon.jpeg
  • Max(Day) at Customer Level
    Level: Customer
    Condition: Nothing
    Transformation: Nothing
ka02R000000kaD6QAI_0EM440000002Fos.jpeg
  • Before closing these metrics, right-click on the Max function and go to Max parameters for both metrics. Set the Fact ID for the Max function to whatever fact used in the metric displaying the data associated with each order, in this case Revenue:
ka02R000000kaD6QAI_0EM440000002Fod.jpeg
  • Create a new filter, and set both of the newly created metrics Max(Day) at Customer Level and Max(Day) at Report Level equal to each other using a Set qualification:
ka02R000000kaD6QAI_0EM440000002Fom.jpeg
  • Place all of the above objects on the report, except for the two Max(Day) metrics and note the following results:
ka02R000000kaD6QAI_0EM440000002Fol.jpeg

 
 
Note that the Max(Day) at Report Level attribute is calculating the purchase date for every Item that the individual has ever purchased, because it is set at the Report Level (which is Item). The Max(Day) at Customer Level attribute is calculating the last order Day that is associated with each individual customer. Here, the filter takes the Max(Day) at Customer Level and compares that day to all of the Items' purchase days, and keeps only those that were purchased on the last order Day for each customer.
 


Comment

0 comments

Details

Knowledge Article

Published:

May 17, 2017

Last Updated:

May 17, 2017