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

KB9221: How to create Last Month Transformation in MicroStrategy Developer 9.4.x-10.x?


Stefan Zepeda

Salesforce Solutions Architect • Strategy


This knowledge base article explains the process of creating Last Month transformation in MicroStrategy Developer 9.4.x-10.x

Even though Month ID information is stored differently in various user environments, this document will illustrate the general process and requirements when creating a Last Month Transformation.
It is important to note that the creation of a Last Month Transformation is different than the creation of a Last Year Transformation, as described in Strategy Knowledge Base document
KB4374 - Are Transformation tables needed to create transformation attributes/metrics in Strategy 9.4.x-10.x?
In the case of 'Year', it is possible to use an expression base Transformation such as Last Year = Year_ID - 1, because if a year ID is 2001, 2001 - 1 = 2000.
However, it is difficult to arrive at a logical expression for 'Last Month'. This is due to the way that the Month ID is stored in the warehouse. In the Strategy Tutorial Project, Month ID is stored as "yyyymm". For example, January 2001 is stored as "200101".
By using the expression Last Month = Month_ID - 1, if Month ID = 200101, then 200101 - 1 = 200100. As "00" does not correspond to a valid month, the expression would not work.
As such, in order to create a 'Last Month' transformation, it is necessary to use a table based transformation. To create a 'Last Month' Transformation, perform the following steps:

  • Create a transformation table in the warehouse. This table should contain two columns: Month ID and Last Month ID (a column may also be added to the Month Lookup table containing data about Last Month), as shown in the screen shot below:
ka02R000000kWyYQAU_0EM440000002G2q.gif
  • After this table is created in the warehouse, open the Warehouse Catalog (Schema Menu) and select the table, moving it to the right panel where the tables are used in projects.
  • Save and Update the Schema (Schema Menu).

Now, perform the following steps to create the actual transformation:

  • Go to File Menu > New > Transformation, as illustrated below:
ka02R000000kWyYQAU_0EM440000002G2e.gif
  • The new transformation window will open, followed by the "Select a member attribute" window. Select the member attribute as 'Month', as shown below:
ka02R000000kWyYQAU_0EM440000002G2h.gif
  • The "Define a new member attribute expression" window will open. Select the table that was created in Step #1 (or the lookup table where the Last Month column was added). In the available columns, select the Last Month ID column (Prev_Month_ID in Strategy Tutorial) and drag and drop it into the expression field on the left, as shown below:
ka02R000000kWyYQAU_0EM440000002G2c.gif
  • Click 'OK' and save the transformation:
ka02R000000kWyYQAU_0EM440000002G2k.gif

For details on how to use transformations to create transformation metrics, refer to Strategy Knowledge Base document
KB5603 - How to create and use transformation metrics in Strategy Developer 9.4.x-10.x?


Comment

0 comments

Details

Knowledge Article

Published:

April 12, 2017

Last Updated:

April 12, 2017