on 06-24-2020 11:03 AM
Hello
I'm trying to create a logical function mixing "IFs" from two dimensions with no success.
I want to calculate the expected harvest of a vineyard that depending on two categories: the grape color (red or white) and the last year of rental agreement.
I have an account-dimension with the "Year of agreement" as a measure
and a generic-dimension with a grape color as an attribute
The two "IFs" functions work perfectly separately. However when I try to combine them, I get validation errors like: "The operator 'AND' can not be used in an IF function"
this is the script of the two separate IFs:
IF ( RESULTLOOKUP([d/account]="AGGRMNT_YEAR") - RESULTLOOKUP([d/Date]=%Current_Year%)) >0
IF [d/VINEYARD].[p/Color]="RED"
Can you please help me to use both of them as a condition for my data action?
Thanks for helping!
PS: attached one of my unsuccessful trial out of many
You can't have multiple Master data filters in IF conditions...
Multiple conditions are very tricky.
Yes, It is very frustrating and unintuitive...
and it's explained in help documentation here:
https://help.sap.com/viewer/00f68c2e08b941f081002fd3691d86a7/release/en-US/afe93e3cf1414a7b8419baad1...
Don't fully get your requirement but try to nest the IF statements, or use memberset and variablemember untill you get there...
IF [d/VINEYARD].[p/Color]="RED" THEN
IF ( RESULTLOOKUP([d/account]="AGGRMNT_YEAR") - RESULTLOOKUP([d/Date]=%Current_Year%)) >0
ENDIF
ENDIF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks, it's not exactly what I need - the formula I use is very complex and needs a data action,
the two "if" are the beginning of my formula but I cannot use them together.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I understood from your demand, I would do like this.
Assuming cars are the color of grapes "attribute".
Quantity is your measure "Year of agreement".
holp this helps
if that's not what you need, let's talk more to understand the demand.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.