How to use Boolean Operations in the Formula as Subsidiary for IF Condition

Similar documents
DB Connect with Delta Mechanism

Step By Step: the Process of Selective Deletion from a DSO

Using Radio Buttons in Web Template

Step by Step Procedure for DSO Creation

Step by Step Guide on How to Use Cell Definition in BEx Query

How to Create View on Different Tables and Load Data through Generic Datasource based on that View

Replacement Path: Explained with an Illustrated Example

Linking Documents with Web Templates

Database Statistics During ODS Activation

Using Nested Exception Aggregation in BEx Reports- Scenario

Explore to the Update Tab of Data Transfer Process in SAP BI 7.0

Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure

Standalone BW System Refresh

Process Chain Log Deletion

How to Display Result Row in One Line While Reporting On Multiproviderer

MDM Syndicator: Custom Items Tab

Step by Step Method for File Archival in BW

Recreating BIA Indexes to Address the Growth of Fact Index Table

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

Extraction of Hierarchy into Flat File from R/3 and Loading in BW System

Information Broadcasting Part 3 Scheduling the First Report

Developing Crystal Reports on SAP BW

SAP BI BO Unit/Currency Logic for Unknown Units Case Study

Data Mining: Scoring (Linear Regression)

Graphical Mapping Technique in SAP NetWeaver Process Integration

Currency Translation in SAP BI Step by step Guide

Hierarchy in Business Objects with Expanded Hierarchy Logic

POWL: Infoset Generation with Web Dynpro ABAP

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP

Material Listing and Exclusion

Step-By-Step guide to Virtual InfoCube Implementation

SAP Net Weaver 400s BI 7.0For more information, visit the Business Intelligence homepage.

Generate Export Data Source

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

Reporting Duplicate Entries

Creation of Key Figures with Higher Decimal Place Precision

Step by Step Guide How to Use BI Queries in Visual Composer

MDM Import Manager - Taxonomy Data (Attribute Text Values) Part 3

Validity Table in SAP BW/BI

Step By Step Procedure to Implement Soap to JDBC Scenario

All about Compression

Errors while Sending Packages from OLTP to BI (One of Error at the Time of Data Loads through Process Chains)

Easy Lookup in Process Integration 7.1

About ITAB Duplicate_Key (SAP lrsaods) Runtime Error

Analysis Process Designer (APD) Step by Step Business Intelligence

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

ABAP Code - Recipients (Specific Format) SAP BW Process Chain

Implying Security on Business Object XI 3.1 Universe having SAP BW as Source

SAP BW Copy Existing DTP for Data Targets

Material Master Archiving in Simple Method

Displaying SAP Transaction as Internet Application in Portal

Data Extraction & DS Enhancement in SAP BI Step by Step

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP

Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008)

Add /Remove Links on ESS Home Page in Business Package 1.5

Purpose of Goods Receipt Message indicator in Purchase Orders

Reporting on Special Stock Values: Snap-shot/Detailed

Cut Over Activities Specific for LIS* Data Sources

Data Mining: Decision Trees

SAP BI Analysis Authorization (Customer Exit Variables)

List of Values in BusinessObjects Web Intelligence Prompts

Data Flow During Different Update Mode in LO Cockpit

Creation of Sets in SAP-ABAP, How to Read them INI SAP-ABAP Reports

Using Query Extract to Export Data from Business warehouse, With Pros and Cons Analyzed

Data Inconsistency in the Cube and Aggregate

SAP BW vs. SAP BusinessObjects Web Intelligence Functionalities

Data Source Replication and Activation of Transfer Structures

Solution to the Challenges in Pivoting

BPM Multi Line Container in Integration Process

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts.

How to Create and Schedule Publications from Crystal Reports

Triggering the Process Chains at Particular Date using Events

Financial Statement Version into PDF Reader

Setting up Connection between BW and R/3 for Data Load

How to Configure User Status in mysap SRM

How to Work with F4 Input Help Effectively in BEX

How to Display Traffic Lights for Exceptions in BI Web Reports

Routines in SAP BI 7.0 Transformations

Freely Programmed Help- Web Dynpro

Reading Enhanced DataSource fields for the Remote Cube

Restricting F4 (Input Help) Values While Running a SAP BW Query

ecatt Part 6 System Data Container

Table Row Popup in Web Dynpro Component

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

BAPI Execution in offline Adobe Form

Customized Transaction to Trigger Process Chain from Failed Step

SDN Community Contribution

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

Planning Functions and Characteristic Relationship in Integrated Planning

How to Default Variant Created for Report Developed In Report Painter/Writer

Common Queries/Errors while working with Adobe Print PDF Forms

BW Reconciliation. Applies to: Summary. Author Bio

Load Info Cube in SCM 5.0 (BI 7.0)

Methods of Selecting BOM Variant Parts in Variant Configuration

Changing the Source System Assignments in SAP BW Objects without Affecting the Data Modeling

Transfer Material Attributes (Material Type) from R/3 to SAP GRC Global Trade Services (GTS)

How to Check BW system Before Go-Live

Download SAP Query Output to Local/ Network Folders in Background

Step by Step Guide for PI Server Start and Stop Procedure

Transcription:

How to use Boolean Operations in the Formula as Subsidiary for IF Condition Applies to: SAP BW 3.5 & BI 7.0. For more information, visit the EDW homepage. Summary This paper will explain you how to use Boolean Operations as subsidiary for IF condition. The article assumes no prior knowledge of Reporting and provides an exhaustive solution replete with screenshots for clear understanding. Author: Aravind Gunta Company: MahindraSatyam Computer Services Ltd. Created on: 16 November 2010 Author Working as a BI consultant with MahindraSatyam Computer Services Ltd. Skill set includes SAP Business Intelligence. 2010 SAP AG 1

Table of Contents Introduction... 3 Business Scenario... 3 The Result... 3 Solution... 3 Use Boolean operations in the formula... 3 Step By Step Procedure... 4 1. Create Data Target based on the scenario:... 4 2. Create Query on the Info Provider:... 5 Logic used... 5 Formula Variable with processing type Replacement path... 6 Calculated Key Figure... 8 Formula using Boolean Operations... 8 The logic goes as below... 8 Formula used is... 8 Result of the Query... 9 Related Content... 10 Disclaimer and Liability Notice... 11 2010 SAP AG 2

Introduction In this Article we will discuss on how to use the Boolean operations in the formula to achieve the expected result for a given Query. Here we will discuss this using a simple scenario. Business Scenario Let s take the Employee report of an organization into consideration for our scenario. In this report the user want to display the number of days an employee is in a particular position. Let us take an employee 104 is having 5 positions (51000132, 51009094, 51031562, 51037596, 99999999), now in the report we need to display the number of days the employee 104 have served in respective positions. The Result When the user executes the Employee Report, the report should provide the details of the number of days the employee have worked in respective positions taking DATE TO as the system date whenever the report is executed. Solution Use Boolean operations in the formula To achieve the above required result, we are going to use the option of Boolean Operations in the formula. Whenever we need to use an IF condition in the report level we can go with the Boolean Operations. In the next step we will see the step-by- step procedure to achieve the above scenario. 2010 SAP AG 3

Step By Step Procedure 1. Create Data Target based on the scenario: Here for our scenario, we will take Employee and the Employee Position as Key fields and DATE FROM and DATE TO in the data fields. Here when we check the field DATE TO for the current position 999999999 we can see that the value is 31.12.9999 (the value is given as 31.12.9999 because we don t know till when he is going to continue in this position). When the report is executed then we will get wrong data for the current position. So to tackle this issue we will make use of Boolean Operations in the formula. For this we will make use of a dummy field, we will define the dummy field in the DSO level and use this in the formula to calculate the number of days an employee is in a particular position. The data in the DSO is as follows. We can see the values for the field DATE0, we have maintained it as 31.12.9999 to use it in the formula. 2010 SAP AG 4

2. Create Query on the Info Provider: Go to the Query designer and create a Query based on the DSO created. Based on our scenario let s take the fields Employee, Position, Date of Joining, Valid From, Valid To and the Date0 in the Rows and in the Columns we will use a formula( we will discuss about the formula in detail ) as below. Logic used Here we are not having any issues in calculating the number of days for all the positions except the current position (we are facing issue because the Date To field is maintained as 31.12.9999 for the current position), to tackle this issue we will use a calculated key figure. Before going to the calculated key figure, as we need to use the characteristics in the formula we need to create Formula Variable with replacement path, for the characteristics: DATE FROM, DATE TO and DATE0. Below are the screen shots for the variables. 2010 SAP AG 5

Formula Variable with processing type Replacement path For DATE0: For DATE FROM: 2010 SAP AG 6

For DATE TO: Here for our scenario we will be using calculated key figure in the formula in combination with the Boolean operations to achieve the required result. The calculated key figure is as below. Date 31.12.9999 - is the formula variable with replacement path, for the field DATE0. Here we are checking if the DATE TO field is 31.12.9999 or not. If the difference is zero then the DATE TO field is 31.12.9999, else some other value. We will use this in the formula and achieve the required result. 2010 SAP AG 7

Calculated Key Figure Formula using Boolean Operations Here we are going to calculate the number of days an employee is in a particular position by using a formula with the help of Boolean Operations. We can use Boolean operations in the formula in place of IF conditions. The result of a Boolean operation is 1 or 0, so we will use this in the formula for IF condition. For our scenario we will check if the calculated Key Figure Date 31.12.9999 is zero or not using the Boolean Operation. We will use the SAP Defined Variable Current Date, to calculate the number of days in the current position. The logic goes as below If DATE TO is not equal to 31.12.9999, then the number of days in the position is the difference between DATE TO and DATE FROM. If DATE TO is equal to 31.12.9999, then the number of days in the Position is the difference between CURRENT DATE and DATE FROM. Here we are going to use the Boolean operations logical equal and logical not equal to. As we know the Boolean operations will result in 1 if the result is correct and will result in 0 if the result is incorrect. Formula used is ( Difference is 0 or not.' <> 0) * ( Date To' - 'Date From ) + ( Difference is 0 or not.' == 0) * ( Current Date' - 'Date From ) 2010 SAP AG 8

Result of the Query When the query is executed we are going to get the below result as expected. In this way we can use the Boolean Operations in the Report and get the expected result. Boolean Operations can be used as subsidiary for IF condition. 2010 SAP AG 9

Related Content For more information please go through these URLs: http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/frameset.htm http://help.sap.com/saphelp_nw04/helpdata/en/0b/b47e78e7d24889af4c7599ba0ddf19/frameset.htm Visit the EDW homepage for more information. 2010 SAP AG 10

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 2010 SAP AG 11