hi guys
im working on a program here and here is the rule
=EITHER(
IF(SIZE(LOOKUP(Ref# Element:REF Segment:LoopCLM2300:In1,Ref#Qual'r Element:REF Segment:LoopCLM2300:In1="D9"))>19,TEXTTODATE(RIGHT(LOOKUP(Ref# Element:REF Segment:LoopCLM2300:In1,Ref#Qual'r Element:REF Segment:LoopCLM2300:In1="D9"),6))),
IF(SIZE(LOOKUP(Ref# Element:REF Segment:IN3,Ref#Qual'r Element:REF Segment:IN3="D9"))>19,TEXTTODATE(RIGHT(LOOKUP(Ref# Element:REF Segment:IN3,Ref#Qual'r Element:REF Segment:IN3="D9"),6 ))),
IF(SIZE(LOOKUP(Ref# Element:REF Segment:LoopCLM2300:LoopHL2000C:In1,Ref#Qual'r Element:REF Segment:LoopCLM2300:LoopHL2000C:In1="D9"))>19,TEXTTODATE(RIGHT(LOOKUP(Ref# Element:REF Segment:LoopCLM2300:LoopHL2000C:In1, Ref#Qual'r Element:REF Segment:LoopCLM2300:LoopHL2000C:In1="D9" ),6)), TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
)
the thing about this code is that regards if the data satisfies the older rule, this is ignored and the data that satisfies the last condition TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD"))) is the one getting mapped. When I removed that code segment, the correct data is not being mapped. Unfortunately, i can not ermoved that code segment since the old rule is a backup in the event that eh new data is not available then the field will have the old data. problem is the old data keeps on getting mapped even if the new one comes along. any thoughts about this issue is greatly appreciated.
thanks
code issue... need help
-
- Participant
- Posts: 2
- Joined: Tue Jul 14, 2009 10:25 am
- Location: Philippines
...
It's not going to be easy without seeing the input data and knowing what you're trying to anticipate, but I will say this;
EITHER says "do the first thing that does not equal none".
So if you say
EITHER (LOOKUP(FIELD)),
LOOKUP(FIELD2)))
If field=none, then it will attempt field2. If field2 is none, you'll get none, but if field or field2 returns a value, it will use the first one that returns something.
Your rule says IF(whatever, do this, else,
....................... IF(whatever, do this, else,
then finally, do TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
Being you're doing all these "IF's", I don't see the need for the EITHER.
You want to use the EITHER;
EITHER(LOOKUP()),
...........LOOKUP()),
...........LOOKUP()),
TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
or use the IF statment;
IF(SIZE(LOOKUP()>19, DATETIME(FIELD1), //ELSE
IF(SIZE(OTHER_LOOKUP)>19, DATETIME(FIELD2) //ELSE
IF(SIZE(ANOTHER_LOOKUP)>19, DATETIME(FIELD3) //ELSE
TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
Know what I mean? This may not fix your code, but try to get it using only one of the ways listed and if you still can't get it, post back.
EITHER says "do the first thing that does not equal none".
So if you say
EITHER (LOOKUP(FIELD)),
LOOKUP(FIELD2)))
If field=none, then it will attempt field2. If field2 is none, you'll get none, but if field or field2 returns a value, it will use the first one that returns something.
Your rule says IF(whatever, do this, else,
....................... IF(whatever, do this, else,
then finally, do TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
Being you're doing all these "IF's", I don't see the need for the EITHER.
You want to use the EITHER;
EITHER(LOOKUP()),
...........LOOKUP()),
...........LOOKUP()),
TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
or use the IF statment;
IF(SIZE(LOOKUP()>19, DATETIME(FIELD1), //ELSE
IF(SIZE(OTHER_LOOKUP)>19, DATETIME(FIELD2) //ELSE
IF(SIZE(ANOTHER_LOOKUP)>19, DATETIME(FIELD3) //ELSE
TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
Know what I mean? This may not fix your code, but try to get it using only one of the ways listed and if you still can't get it, post back.
-
- Participant
- Posts: 2
- Joined: Tue Jul 14, 2009 10:25 am
- Location: Philippines
Re: ...
Im still getting the same output wherein the "else" gets mapped bypassing the other results
rep wrote:It's not going to be easy without seeing the input data and knowing what you're trying to anticipate, but I will say this;
EITHER says "do the first thing that does not equal none".
So if you say
EITHER (LOOKUP(FIELD)),
LOOKUP(FIELD2)))
If field=none, then it will attempt field2. If field2 is none, you'll get none, but if field or field2 returns a value, it will use the first one that returns something.
Your rule says IF(whatever, do this, else,
....................... IF(whatever, do this, else,
then finally, do TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
Being you're doing all these "IF's", I don't see the need for the EITHER.
You want to use the EITHER;
EITHER(LOOKUP()),
...........LOOKUP()),
...........LOOKUP()),
TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
or use the IF statment;
IF(SIZE(LOOKUP()>19, DATETIME(FIELD1), //ELSE
IF(SIZE(OTHER_LOOKUP)>19, DATETIME(FIELD2) //ELSE
IF(SIZE(ANOTHER_LOOKUP)>19, DATETIME(FIELD3) //ELSE
TEXTTODATE(FROMDATETIME(FileDate, "CCYYMMDD")))
Know what I mean? This may not fix your code, but try to get it using only one of the ways listed and if you still can't get it, post back.