Solved

what is difference between Fix and IF?

Posted on 2009-07-08
4
1,985 Views
Last Modified: 2012-06-21
what is difference between Fix and IF?
0
Comment
Question by:AJITPADHY
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
garycris earned 500 total points
ID: 24803865
Both are used to focus your calculation to a subset of data in your cube

The FIX&ENDFIX command block restricts database calculations to a subset of the database. All commands nested between the FIX and ENDFIX statements are restricted to the specified database subset.

This command is useful because it allows you to calculate separate portions of the database using different formulas, if necessary. It also allows you to calculate the sub-section much faster than you would otherwise.

So if I say
FIX ("Jan");
"Margin" = "Sales" - "COGS";
ENDFIX;

When I run this calc, Margin will only be calculated for the month of January.

'IF' Performs conditional tests within a formula. Using the IF statement, you can define a Boolean test, as well as formulas to be calculated if the test returns either a TRUE or FALSE value.

So similar to above, I can say

IF(@ISMBR("Jan"));
"Margin" = "Sales" - "COGS";
ELSE
"Margin" = #MISSING;
ENDIF;

In this case I test to see if the member being calculated is Jan, if it is then I run the Margin formula, otherwise I set Margin to Missing (NULL).

If your thinking they do the same thing, in some ways they do, but in other ways they allow you to do different things.  FIX assumes you know explicitly what you want to focus on, IF allows you to test conditions and then decide whether to calculate.  You might have a formula that calculates bonuses and you could have something like
IF ("Sales" > 2000000)
"Bonus" = "Sales" * .015;
ELSEIF ("Sales" > 1000000)
"Bonus" = "Sales" * .01;
ELSE
"Bonus" = #MISSING;
ENDIF;

In this case if Sales is not greater 1 million then there is no bonus. If it is greater than 1 Mil but less than 2 mil, then there is a 10% bonus and if greater than 2 mil, then there is a 15% bonus.

There are also performance considerations.
Using IF on a large Sparse dimension can be bad as it has to cycle through all the data blocks in the Index file to see if they meet the criteria.  Generally speaking a FIX is more efficient on Sparse dim.
IF can be more efficient on a Dense dim opposed to multiple FIX statements because the IF allows Essbase to evaluate the block once while it is in memory rather than have to move it in and out of memory multiuple times.
0
 

Author Closing Comment

by:AJITPADHY
ID: 31600995
thanks
0
 

Author Comment

by:AJITPADHY
ID: 24825577
thanks
0
 

Author Comment

by:AJITPADHY
ID: 24825580
thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now