Skip to Content
Author's profile photo Former Member

Use of Interpret result as Boolean Value (True=1;False=0) in formula variable with an example

Scenario :

With this document i will be showing the functionality of  “Interpret result as Boolean Value (True=1;False=0)” in formula variable with a simple example .

The scenario is like below :

Requirement : To show in the output of the BEx report only paid invoices.

DSO Data :

ZINV_NO – Invoice No

BEX1.jpg

ZINV_NO Master data :

As we can see below from the master data of “ZINV_NO” , there is a Paid indicator (display attribute of ZINV_NO) which tells us whether its an “open invoice” (with a blank space ” ” ) or a “paid invoice” (with the value “X”).

BEX2.jpg

Follow the below steps to get only paid invoices amount in the output of BEx report based on the Paid Indicator(ZPAID):

STEP : 1

In the BEx query designer make a New formula(For Ex : Paid Amounts) and in that make a new formula variable with the following settings in the general tab :

Processing Type : Replacement Path

Reference characteristics : ZINV_NO

BEX3.jpg

STEP : 2

Go to the replacement path tab and maintain the following settings:

Replace variable with : InfoObject

Replace with : Attrib. Value

Attribute : ZPAID

And select the checkbox “Interpret Result as Boolean Value(True=1; False=0)

BEX4.jpg

STEP : 3

Now multiply this formula variable with the amount keyfigure from the infoprovider :

BEX5.jpg

STEP :4

Just to check what this formula variable is bringing, make a separate NEW FORMULA ( For ex: Check) and just place this formula variable and also maintain AMOUNT keyfigure in the columns also just to get a better clarity of what is happening :

BEX6.jpg

STEP : 5

Finally your BEx Query designer should look like this :

BEX7.jpg

STEP : 6

Execute the report to see the output.

BEX8.jpg

Explanation :

The formula variable : ZFOR_VAR_BOOL internally checks for the attribute “ZPAID” of “ZINV_NO”. The value of the formula variable is 0 when it does not find value(i.e. blank) for the attribute ZPAID and the value of the formula variable is 1 when it finds value(i.e. “X” in this case) for the attribute ZPAID.

Hope the above explanation was useful.

All comments and suggestion are welcome !!

Assigned Tags

      16 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Anshu Lilhori
      Anshu Lilhori

      Good piece of information..Great explanation with proper scenario.

      Thanks for sharing..

      Keep up the good work!

      Regards,

      AL

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thx Anshu.

      Will keep up the good work !!

      Author's profile photo Former Member
      Former Member

      Hi Ashutosh,

      Its really helpful, thanks for sharing with screen shots.

      Regards,

      Giri

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hey Giri

      Thx for the valuable comments.

      I am glad that its helpful for you.

      Author's profile photo Sandeep a
      Sandeep a

      hi ashutosh,

      thank for sharing your idea.

      🙂

      regards

      Sandeep

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hey Sandeep,

      Thanks.

      Will post more interesting and useful documents.

      Author's profile photo Abdullah Qureshi
      Abdullah Qureshi

      Nice piece of Information Ashutosh..

      Keep Exploring.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hey Abdullah,

      Thanks for your valuable comments and yes I will keep exploring.

      Regards,

      Ashu

      Author's profile photo Benedict Venmani Felix
      Benedict Venmani Felix

      Thank you Ashutosh. .That was some useful piece of information. I always wanted to know what this option did but never cared to try it out myself. 😛

      Benedict

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hey Benedict,

      Thx for the valuable comments.

      And I am glad that you now know this piece of information through my document.

      Will keep posting more useful information.

      Regards,

      Ashu

      Author's profile photo prabhith prabhakaran
      prabhith prabhakaran

      Hi Ashutosh,

      Very neatly explained,,

      Thanks for sharing.

      BR

      Prabhith

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thx prabhit for your kind words !!

      Author's profile photo Kamal Mehta
      Kamal Mehta

      Hi Ashutosh,

      Very good explanation.

      Please keep sharing and keep doing good work.

      Bookmarked it.

      Thanks

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Kamal,

      Thanks for the appreciation. I will keep sharing new ideas with you guys.

      Regards,

      Ashu

      Author's profile photo sree hari
      sree hari

      Small and informative.

      Thx

      sree

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thanks sree for the valuable comments !!