do not apply sum function in sql vldb microstrategy. KB11125: How to control the join order of metrics in the final pass when using the "Do not do downward outer join" VLDB setting in MicroStrategy SQL Generation Engine. do not apply sum function in sql vldb microstrategy

 
KB11125: How to control the join order of metrics in the final pass when using the "Do not do downward outer join" VLDB setting in MicroStrategy SQL Generation Enginedo not apply sum function in sql vldb microstrategy  The SQL hint VLDB property places the desired custom SQL inbetween the select keyword and the columns in SQL This article notes how to setup Ranking for metrics that do not return data for all attribute elements Apply functions: These functions provide access to functions and syntactic constructs that are not standard in MicroStrategy but are offered by various relational database management system (RDBMS) platforms

The impact is limited to MicroStrategy Command Manager 9. 1 - 10. Uncheck the 'Use default inherited value' check box, if it is checked, and set the option to 'Permanent Table,' as. In general, a user specifies a list of conditions and corresponding return values. The default syntax can be modified by using 'Column Pattern' VLDB property. Need to find the sum of the bill amount for particular orders. Helps optimize custom group banding when using the Count Banding method. Let us create one simple table named numbers and store the. By default, the metrics Compound Profit and Profit Margin do not use a dynamic aggregation function. 4. It has two options: Disable Set Operator Optimization: SQL will be generated as in previous versions. They act as containers for non-standard SQL expressions that MicroStrategy does not support. The 'Where clause driving table' Very Large Database (VLDB) property indicates to the MicroStrategy Engine which table to use when a filter needs to be applied. This article does contain a solution. The Preserve All Lookup Table Elements VLDB property is used to show all attribute elements that exist in the lookup table, even though there is no corresponding fact in the result set. SELECT SUM(DISTINCT salary) AS "Total Salary" FROM employees WHERE salary > 25000; If there were two salaries of. However, the expression '' alone will not check for NULLs although the Very Large Database (VLDB) setting is activated. 0. Case functions return specified data in a SQL query based on the evaluation of user-defined conditions. The 1NF table will have one number per row, and will contain more rows than the initial table. =SUMIF (range, criteria, [sum_range]) Range = range of cells where you want to check the criteria. 0, a VLDB property is available to control the join behavior between component metrics in a nested compound metric: "Nested Aggregation Outer Join," located under Joins in the VLDB property editor. If all conditions are false, a default value is returned. They can also help you take more advantage of the data. This version of the product is no longer supported in accordance with MicroStrategy's support lifecycle. FROM OrderDetails WHERE ProdictId = 11; Try it Yourself » Use an Alias Give the summarized column a name by using the AS keyword. This function is commonly used in metrics and subtotals. Apply (Pass-Through) Functions MicroStrategy Apply. Select the Members tab. tion. This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. Interact with the engaged MicroStrategy Community to get answers to all your. Browse to the filter you want to convert. This can be inconvenient when reports do not hit Intelligent Cubes, because the report designer will need to have access to the log file on the Intelligence Server machine. x. 10 / 10. To use an element list prompt with Freeform SQL, the following conditions must be met: The prompt must be based on an attribute in the project's primary schema (a Freeform SQL or. The 'Create Individual Index' VLDB setting was introduced in MicroStrategy 8. If M1 equals V1, then a specified value can be returned. A given VLDB setting can support or. Other databases, such as some versions of Teradata, have a mix of the join standards and therefore need their own setting. In the examples in this article, we will be using a 12 TB database, appropriately named VLDB01. Viewing and Changing VLDB Properties. To do so, click Tools > Report Details Page after the report has been executed, as shown below: This will bring up the Report Details window for the specific report. Or embed self-service capabilities for users to visualize key drivers or what-if scenarios. Go to Data > VLDB Properties > Joins > "Preserve all final pass result elements. In MicroStrategy, there is a Very Large Data Base (VLDB) property, "Additional Final Pass Option," that configures whether or not the engine will optimize SQL into a single pass when possible. A given VLDB setting can support or. Ca se functions Microstrategy Case functions return specified data in a SQL query based on the evaluation of user-defined conditions. Types of variables Before going into the details of the types of Apply Functions , I will point out that these functions require certain variables to be passed as parameters. This article describes how to create a metric with an attribute as a filter using a Case statement in a Visual Insight dashboard in MicroStrategy Web. However after re-migrating the freeform SQL report to the target environment, the report still shows the results with the total subtotal function and dynamic. If you are editing the If function, use the values in step 7. The 'Group By ID Attribute' VLDB property is not applied in a MicroStrategy Desktop 8. CAUSE: The MicroStrategy SQL Generation Engine distinguishes between the SQL passes generated for the Report (to return the data for the result set) and the passes generated for the datamart (to create and populate the datamart table) when applying the VLDB settings. When you need to use an Apply function, MicroStrategy encourages you to submit an enhancement request for inclusion of the desired feature in a future product release. Right-click on the report and click on the 'Edit' menu. x and later). The VLDB property's behavior will be demonstrated using the following attribute and report. If parentheses are required in the database syntax, it is the user's responsibility to provide them, e. Option 1: Keep the backward compatibility with MicroStrategy 2019 where SQL queries are governed by Cartesian Join Warning VLDB. You can re-use the same formula in multiple metric definitions. This article covers the purpose of the where clause driving table property. Sum . 4. A report that shows sales for all the years and all the customer regions even if sales do not exist in the intersection of them can be achieved by the use. If that level is also set to the default or if the VLDB property is not set at the project level, the setting at the database instance is used. This VLDB property specifies the type of intermediate storage structures the SQL Engine creates. DataFrame. They act as containers for non-standard SQL expressions that MicroStrategy does not support. To do so, click Tools > Report Details Page after the report has been executed, as shown below: This will bring up the Report Details window for the specific report. ACTION: This is addressed MicroStrategy 11. PROJECT. In general, a user specifies a list of conditions and corresponding return values. The syntax for the If function is IF (Condition, TrueResult, FalseResult) where:Explanation. To do this, the "Preserve all final pass result elements" VLDB property must be set at both attribute and report level. Select the Security Filters tab. Join common key on both sides. All of the template attributes will be considered as a unit. This function is commonly used in metrics and subtotals. Instead, it. Enable Set Operator Optimization (if supported by database and [Sub Query. Tutorial project is used here. Ca se functions Microstrategy Case functions return specified data in a SQL query based on the evaluation of user-defined conditions. If the MEMBER_NAME is 03/05/2007, the SQL Date Format should be mm/dd/yyyy. Attribute form expressions must be rendered into SQL and cannot use any MicroStrategy functions specific to the Analytical Engine. For information about accessing these properties, see the page reference for each property in the table below. The Apply functions are not meant to take. Beginning with MicroStrategy 9. In such a case, Report Pre and Post Statements from all database instances will be ignored. In the event of a code change in future builds, MicroStrategy may not be able to provide additional code on this matter even though this customization is provided. ; In some limited cases you can rewrite the aggregate to avoid. ; Distinct is a TRUE/FALSE parameter that allows you to. Sum <Distinct, FactID, UseLookupForAttributes>(Argument)Where: Argument is an attribute, fact, or metric representing a list of numbers. This document introduces how to apply conditional logic on a derived metric according to attribute form whose type is character. Two different passes of SQL for metrics which only differ via a simple filter are note merged via SQL Global Optimization levels 3 and 4 despite notes that it can. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. x and 10. In MicroStrategy SQL Engine, a VLDB setting "Custom Group Interaction with Report Filter" exists to manage different situations in which a Custom Group interacts with the report filter. Passes that hit the same fact table across different elements of a custom group are merged provided that they satisfy certain conditions. If no ordering is specified, the result of some window functions (e. The SUM() function, like other aggregate functions, is typically used with the GROUP BY clause. expression is an expression of the exact numeric or approximate numeric data type category, except for the bit data type. Double-click the CUST_LAST_NAME column to add it to the Form expression pane on the right. Is a constant, column, or function, and any combination of arithmetic, bitwise, and string operators. x includes a VLDB property, 'CREATE and INSERT Support,' under the Tables folder, at the database instance level. Explain how MicroStrategy handles metadata. Without this option all reports would execute their SQL pass by pass in a sequential order over a single database connection. This article describes how to create a metric with an attribute as a filter using a Case statement in a Visual Insight dashboard in MicroStrategy Web. This sometimes produces SQL that is expensive to run on the database, particularly if multiple attribute lookup tables are combined using cross joins. Example: The SQL below is from a report that can use parallel execution. , row number) is non-deterministic. Case. In MicroStrategy Developer, right-click a metric and select Edit. Note: To create custom expression qualifications, the advanced qualification option must be enabled in the report designer's preferences in MicroStrategy Desktop 8. Define the statistics and enterprise warehouse database. , a temporary table is created but not referenced in a later pass; Reuses redundant SQL passes KB37567: MySQL table specific SQL hints cannot be used in reports against MicroStrategy 9. 5, multi-source reports inherit the Report Pre/Post Statement VLDB setting only from…Normally, MicroStrategy SQL Generation Engine 9. This setting can substantially reduce the number of SQL passes generated by MicroStrategy. The "Grouping" property has six possible settings, of which four specify non-aggregating behavior: Beginning (fact) Ending (fact)This issue has been classified as a defect by MicroStrategy. 36. What I ended up doing is run the query without the Sum () Function and then use the Totals feature that is available on forms in Datasheet view. When a Freeform SQL report's query is submitted to the database, the entire query text is sent using a single ODBC SQLExecDirect call. This setting can reduce the number of SQL passes generated by MicroStrategy. If you choose Temp Table Join. The following list of articles can be used for further reference regarding the 'derived table' behavior with MicroStrategy SQL engine. Aggregate functions and subqueries are not. Specify a name and location for the new security filter and click Save. This article describes how to use wildcards to display temporary table names in pre/post statements. In MicroStrategy, there is a Very Large Data Base (VLDB) property, "Additional Final Pass Option," that configures whether or not the engine will optimize SQL into a single pass when possible. The following list of articles can be used for further reference regarding the 'derived table' behavior with MicroStrategy SQL engine. So when the value was changed to 'Check for NULL in all queries' at the report level, the MicroStrategy SQL Generation Engine issued a NULL validation for the metric. This metric divides the sum of VOL fact at report level by [Net Weight] after applying it a character replace at BBDD level with ORACLE's replace function (it seems that the BBDD is ORACLE), and breaks it down by product. This is a single-value function. Or, the MEMBER_NAME might be March 5, 2007, in which case the SQL Date Format would be mmmm d, yyyy. The following. In general, a user specifies a list of conditions and corresponding return values. In this case, the report SQL may not be possible to complete on the database. You can apply transformations to simple metrics but not for compound metrics. For complete details about all VLDB properties, see SQL Generation and Data Processing: VLDB Properties. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. [M1]:. In the Metrics folder, two available options are shown as below: 'Transformable Aggmetric' -- False Metadata partitioning is the term that MicroStrategy uses to distinguish a partitioning setup that is stored in the MicroStrategy Metadata repository. This query does not return all desired elements of category from the Data Warehouse. x as the SQL hint VLDB property doesn't generate the desired SQL. With VLDB properties correctly configured, a report can join to some lookup tables using outer join and others using inner join. Column aliases allow you to specify a more appropriate data type that can help avoid errors in your SQL. Report as Filter inherits its parent report's VLDB setting instead of using its own. Syntax. SQL Syntax for Ordered Analytic Functions: Moving average example: select a11. This article describes how to change the syntax for column names using the column pattern VLDB propertyIn SQL, the formula commonly becomes part of the SELECT clause of the SQL command. In the VLDB Properties, locate option "Distinct/Group by Option (when no aggregation and not table key)" under Select/Insert tab. It is possible to disable the warning by setting ansi_warnings off but this has other effects, e. That Stored Proced has an Input Parameter which I need to. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. Write VLDB properties? VLDB stands for Very Large Data Base Properties. This function is used to display the ranking of values in a list relative to the other values. In these cases, the MicroStrategy SQL Engine uses the value set in the VLDB setting, 'Fallback Table Type'. How to avoid: By default, MicroStrategy uses database connection caching. MONTH_ID IN (#E1). This means that the MicroStrategy internal OLAP function 'MovingSum' will be performed on the Sum() aggregation, sorted by the month ID with a window size of 2 (2 last values). Instead, they are intended to enhance the MicroStrategy product by taking advantage of what the RDBMS platforms can offer. Beginning with MicroStrategy SQL Engine 9. To access the parameters for the function, in the metric. The calculation can restart based on attributes identified in the parameter settings. Modifying any VLDB property should be performed with caution only after understanding the effects of the VLDB settings that you want to apply. The VLDB settings report now displays all the default settings for the data source. The location of each property in the CREATE TABLE statement is given below. The only tables that are needed are the. This article describes how MicroStrategy uses subqueries and how the options of the "Sub Query Type" VLDB property control the SQL syntax used. After a report is run, we keep the connection open (DB connection timeout values apply). Case Functions. Select the Security Filters tab. The following list summarizes the metric-specific VLDB properties that can be set at the metric level. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. A comment that passes instructions to a database optimizer about choosing an execution plan for a given SQL statement. The image below shows the SQL view of the Report Pre Statement 5s output. MicroStrategy’s OLAP functions are calculated via SQL in Teradata rather than in the MicroStrategy analytical engine. To do this, the "Preserve all final pass result elements" VLDB property must be set at both attribute and report level. If not, the permanent table’s option is the default setting. If the option for multiple passes is selected, all metric calculations will be performed in separate passes. e ('Call [SP]') it does not. ApplyOLAP – Uses OLAP functions such as Rank, Ntile, and so on. xml file in the "Program Files (x86)Common FilesMicroStrategy" folder on a machine with MicroStrategy Developer installed and create a backup of this file, and then edit it. If M1 does not equal V1, then M1 is compared to the next value V2 in the list. VLDB properties allow you to customize the SQL that MicroStrategy generates. Note: This behavior does not apply to server-level partitioning, in which tables are partitioned natively within the database. The above example would not be valid with multiple months in the answer because the >= expects single values for its operands. Some databases, such as DB2, support both Join 89 and Join 92. [CATEGORY_ID] AS CATEGORY_ID, sum(a11. The SUM () function returns the total sum of a numeric column. . g. Group by column. 0. 5. CAUSE: By checking the SQL statements of the report, there is no "sum" or "group by" statement. This VLDB setting is located in the 'Indexing' folder and has the following options:The 'Create Individual Index' VLDB setting was introduced in MicroStrategy 8. This article describes an issue where attribute elements that include trailing spaces are not returned as separate attribute elements when Filtering on the String Values VLDB property is set to "Do not trim trailing space" in MicroStrategy 10. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. In general, a user specifies a list of conditions and corresponding return values. The above example would not be valid with multiple months in the answer because the >= expects single values for its operands. Single SQL pass time-out in seconds. The database was created with files stored directly in Azure blob storage , using a Premium Storage. CONTENTS 1. CREATE and INSERT statements are not supported. the MicroStrategy SQL Generation Engine generates the following SQL for a report in Tutorial that requests the sum of units received for each Item, Quarter and. This section focuses on the VLDB properties that are set at the metric and report level. 2) Create Metric2 as the RunningSum of Metric1. Open the VLDB Properties Editor this way. The SQL SUM () Function. Create a new Report: Add Quarter, Customer, and Profit to the template. Each of the functions in this category substitutes for one of the function types mentioned above and can be used wherever that type is used. This VLDB settings influence the table creation type in the SQL passed to the Teradata database when Intermediate Table Type is set to True Temporary. While this code may apply to other releases directly, MicroStrategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. While this code may apply to other releases directly, MicroStrategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. The example below outlines how to create a Sum custom subtotal that only totals the last two metric values . The following steps describes how to create such derived metric. ) will apply. MicroStrategy’s mobile support ensures flexible, real-time data exploration. METRIC. The first four statement VLDB properties, each can contain single SQL statement. " In MicroStrategy SQL Generation Engine 8. g. This article explains the behavior of the commit level VLDB property35. 2 metric aggregations will not be dimensionality aware. This article describes how the "Set Operator Optimization" VLDB property works in MicroStrategy Controls whether tables are joined only on the common keys or on all common columns for each table. This procedure assumes you are already working with a metric in the Metric Editor. CAUSE: MicroStrategy can support multiple (more than 5) pre-statements to put in a report. CAUSE: By checking the SQL statements of the report, there is no "sum" or "group by" statement. For Compound Profit to be dynamically aggregated correctly, you change the dynamic aggregation function to Sum. . This allows the FOJ to be rewritten to a different kind of join in the query. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. . Apply Functions provide the capability for MicroStrategy customers to leverage functions specific to RDBMS but not standard in MicroStrategy. -1 (Use value from higher level) Limiting Report Rows, SQL Size, and SQL Time-Out: Governing. This type of formula is called a base formula, which can contain arithmetic operators, attributes, facts, group functions, and non-group functions. If the option for multiple passes is selected, all metric calculations will be performed in separate passes. When MicroStrategy queries the data warehouse, the software determines which condition evaluates as true and then returns the value that the. A VLDB database. Subqueries (or correlated subqueries) are used infrequently but significantly in the MicroStrategy SQL Generation Engine. It controls whether the indexes will be created separately for each column or whether the indexes will be created together for multiple columns. [TOT_DOLLAR_SALES]) AS Revenue into [ZZEA00] from. You can, however, use a function that does not match the function or functions used to define the metric. VLDB properties allow you to customize the SQL that MicroStrategy generates, and determine how data is processed by the Analytical Engine. You can click an object or continue to type. In general, a user specifies a list of conditions and corresponding return values. Number of Views 822. on how division by zero is handled and can cause failures when your queries use features like indexed views, computed columns or XML methods. create /* Table Qualifier */ table /*Table. Tables − They simply represent data in a tabular form (columns and rows). Metric with an IF Function. Ans: MicroStrategy enables ad hoc analysis through an intuitive interface. The attribute uses a CASE statement to replace NULL values with -999. This is a database instance level VLDB setting. The option is available in the Project Level VLDB properties under "Query Optimizations" as seen below. To configure:-. This technical note outlines an issue where certain database-instance level VLDB properties are not being applied to the SQL Engine. In these cases, the MicroStrategy SQL Engine uses the value set in the VLDB setting, 'Fallback Table Type'. g. The types of arguments determine how the parameter markers inside the pattern are replaced. Helps optimize custom group banding when using the Count Banding method. In MicroStrategy SQL Generation Engine, security filters prevent users from seeing certain data in the database. Function. This property can only be enabled through Workstation. Inputs for predictive metrics in Microstrategy; MSTR Passthough Functions; Applysimple, ApplyCompa. To access the parameters for the function, in the metric. Open MicroStrategy Developer. x mixed case columns names for a DB2 database by default have SQL generated with quote characters enclosing the name . pandas. e. When you need to use an Apply function, MicroStrategy. CREATE and INSERT statements are not supported. To use previously defined in Db2 function in MicroStrategy, you can use the MicroStrategy built-in Apply (Pass-Through) Functions or use Freeform SQL. Expand the 'Administration' Icon, and select the Database Instance Manager. REGION_ID REGION_ID, max(a13. In that case, MicroStrategy accesses the partitioned data transparently by referring to a single table name. Open the VLDB Properties Editor to display the VLDB properties for the level at which you want to work. In the event of a code change in future builds, MicroStrategy may not be able to provide additional code on this matter even though this customization is provided. The VLDB setting "Do not do downward outer join for databases that support full outer join" is appropriate in the following situations:The following steps provide an overview for configuring secure Freeform SQL text prompts: Step 1: Identify Database Support for Parameterized Queries. However, you want to show all the store. e. For use cases, examples, sample code, and other information on every VLDB property. It is, consequently, displaying a total which is. This issue has been addressed starting in MicroStrategy 9. Analyze the low performance query using DBA knowledge, add. Example: Create a new custom subtotal object. MicroStrategy download site to. . VLDB Settings. SELECT SUM(DISTINCT salary) AS "Total Salary" FROM employees WHERE salary > 25000; If there were two salaries of. Navigate to Tools > Advanced Settings > VLDB Properties to open the VLDB properties editor. Return the sum of the values over the requested axis. Right-click the Customer attribute and select New Attribute form. ADDITIONAL INFORMATION:. The last statement can contain multiple SQL statements concatenated by “;”. However, users can optimize this SQL for large data warehouses by changing the Sub Query Type VLDB property. If parentheses are required in the database syntax, it is the user's responsibility to provide them, e. There are two options for this property: CREATE and INSERT statements are supported. In general, ApplySimple can be used to create the following objects: •. x introduces a third option to the VLDB Property "Drop Temp Table Method. Sum is a group-value function. This setting provides two options - 'Permanent table' or 'True temporary table'. 1) When I execute the STored Procedure by setting it in PreSQL. So when the value was changed to 'Check for NULL in all queries' at the report level, the MicroStrategy SQL Generation Engine issued a NULL validation for the metric. MicroStrategy’s OLAP functions are calculated via SQL in Teradata rather than in the MicroStrategy analytical engine. One of the options under Analytical Engine folder is called "Metric Level Determination. In the latter case, intermediate tables would be left on the database; administrators could remove them using a database-side scheduled task. sum. The calculation can restart based on attributes identified in the parameter settings. , a temporary table is created but not referenced in a later pass; Reuses redundant SQL passesKB37567: MySQL table specific SQL hints cannot be used in reports against MicroStrategy 9. Help your customers get more out of the app experience with an engaging AI assistant that provides automatic answers or outputs in real time. Return the sum of all Quantity fields in the OrderDetails table: SELECT SUM (Quantity) FROM OrderDetails; Try it Yourself ». Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. Create the statistics database instance. We use MicroStrategy Tutorial objects to create this example. IMPORTANT: If Report Pre and Post Statements are defined in report or template level VLDB Properties, these will override the settings in database instances. Attribute form. a temp table is created but not referenced in a later pass. To force a Null check for the second case, use the Function 'NullToZero' either in the metric or Fact Editor. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. (0 = unlimited number of rows; -1 = use value from higher level. It does not apply to situations where index creation occurs before insertion of data. Embedded Analytics Solutions Solutions; Financial Services; Healthcare; Retail; GovernmentThis article explains the behavior of the commit level VLDB propertyTo simplify the explanation, this function is used to apply non-standard SQL expressions that MicroStrategy does not support or does not support. The ApplyAgg function itself is a group-value function and accepts facts, attributes, and metrics as input. " The default value here is "Include only lowest-level attribute in metric level (recommended for version 9. ) User-defined. Using the Select Statement Post String VLDB property, MicroStrategy can support this. As these accounts do not have access to "Configuration Managers" in the Administration tab, the only way to view the VLDB. To provide a reasonable level of generality, the feature is based on a 'pattern and arguments' scheme. Apply (Pass-Through) Functions MicroStrategy Apply Functions provide access to functions or syntactic constructs that are not standard in MicroStrategy but are provided by various Relational. Tutorial project is used here. DAY_DATE DAY_DATE, a12. This VLDB setting is located in the 'Indexing' folder and has the following options:The following example demonstrates the use of the VLDB property "Compute Non-Agg before/after OLAP functions (e. 0 and higher). Microstrategy fetches the list of values to be displayed in an Attribute Element Prompt by executing two passes of SQL as seen below: Pass 0. Accessing Report VLDB Properties. If an attribute is the lowest level attribute in a hierarchy, then the MicroStrategy SQL Engine will place a key beside this attribute in its logical table view. Key distinctions of the RANK function are that it requires an order by clause and does not support a window clause. Case. However, MicroStrategy cannot guarantee an optimal ordering of tables unless there is at least one report level metric. The Profit metric is a simple sum of the Profit fact. Sum <Distinct, FactID, UseLookupForAttributes>(Argument)Where: Argument is an attribute, fact, or metric representing a list of numbers. September 18, 2018. The property is named "document grids from multiple datasets" and defaults to enabled but can be set to disabled. While the grand total is also a sum of all the values across the grid, it does take into account the dimensional awareness of the metric, when the "Subtotal Dimensionality Aware" is set to ‘True’. MicroStrategy may not be able to provide additional code on this matter even though. As shown below, for a specific report, the 'Group By ID Attribute' VLDB property is set to 'Group by column' instead of 'Group by expression' to avoid using an ApplySimple. Intelligence Server computes the new fact Trunc([Dollar Sales]) first and then uses the Sum function to sum the new fact for each region. The window size is a parameter which tells the function how many of the values should be included in the calculation. Qualify on the attribute form that you want to compare (presumably the Year ID), and then in the Operator section, change the dropdown from its default 'Value' to 'Custom'. Create a metric with the ApplySimple statement below as its definition and name it. As a result the report throws. If M1 does not equal any of the values in the list, then it returns a default value. Unless the defaults are changed, the function ranks the values in ascending order by the value of the metric, and the rank is an integer. While the default values should result in the best report performance in most cases, some reports may perform better when certain VLDB Properties are set to non-default values. MicroStrategy SQL Generation engine 10.