on 06-15-2011 11:28 PM
Is there a way to create an object in a universe that is based off four other fields? For example, I want to have a field that can have four different values -- A, B, C, D. It will be a string format. The value that populates is based off upto four other existing string fields. Using basic If Else statement, it would look like this:
If
Field1<>"Z" Then "A"
Else
If Field1="Z" AND Field2<>"Z" Then "B"
Else
If Field1="Z" AND Field2="Z" AND Field3<>"Z" Then "C"
Else
If Field1="Z" AND Field2="Z" AND Field3="Z" AND Field4<>"Z" Then "D"
Is this possible within Designer? It's built off SAP BW. If not, what would be the best way to go about it.Thanks.
Hi,
One way you can do it on the webi level by If Else condition.
Thanks,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use a case statement in your object definition. The basic logic would be:
CASE WHEN Field1 ='Z' Then 'A'
WHEN Field1='Z' AND Field2='Z' Then 'B'
WHEN Field1='Z' AND Field2='Z' AND Field3='Z' Then 'C'
WHEN Field1='Z' AND Field2='Z' AND Field3='Z' AND Field4'Z' Then 'D'
END
However, the last three options would never happen because case statements finish upon satisfying the earliest condition. In your example, whenever Field1='Z', you will always output 'A'. Also, you have no ELSE variable at the end for when Field1 is not Z
So, something like this would be better:
CASE
WHEN Field1='Z' AND Field2='Z' AND Field3='Z' AND Field4'Z' Then 'D'
WHEN Field1='Z' AND Field2='Z' AND Field3='Z' Then 'C'
WHEN Field1='Z' AND Field2='Z' Then 'B'
WHEN Field1 ='Z' Then 'A'
ELSE 'E'
END
If you need any further clarification, let me know.
Regards,
Mark
Edited by: Me map on Jun 16, 2011 9:56 AM
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.