Query development (IF statements)

Question: Is it possible to use IF statements, or something similar, in BW queries?

Regards,

Frederick

Answer:
Yes, Boolean operators in Calculated KF.
_________________
When my car stops, I first look at the gasoline's level before dismounting the engine.


Tuly Idiot's fan club active member.

Answer:
I am now using Boolean operators, and found more information on these in the search facility. Thanks.

The next problem is that BW returns a red X sign when the value in one of the condition cells is blank... I can see that the IF logic above is working because the result varies according to the conditions entered but only if these cells contain values (otherwise I get the red X).

I have tried everthing since yesterday but cannot get this to work. All comments welcome,

Thanks, Frederick

Answer:
If a cell in a BW workbook is empty, how can i tell BW to ignore it for the purposes of a multiplication calculation ? In these cases, it is returning a Red X, but I want it to return zero.

The calculation is for sales price variances, and I don't want to calculate a variance if any of the values are zero. But this is proving very difficult.

Regards,

Frederick

Answer:
If a cell in a BW workbook is empty, how can i tell BW to ignore it for the purposes of a multiplication calculation ? In these cases, it is returning a Red X, but I want it to return zero.

The calculation is for sales price variances, and I don't want to calculate a variance if any of the values are zero. But this is proving very difficult.

Regards,

Frederick

Answer:
here it is:
Conditional Calculations (IF-THEN-ELSE)
You can make conditional calculations using Boolean operators An expression in the form
IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
<Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2>



Example: IF Actual Costs > Plan Costs THEN Plan Costs + Plan Deviation ELSE Actual Costs

can be written as the following formula:

(Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (NOT (Actual Costs > Plan Costs)) * Actual Costs

or

(Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (Actual Costs <= Plan Costs) * Actual Costs
Copyright ?2007 - 2008 www.jt77.com