Log in Register FAQ Memberlist Search ContactReview Forum Index
A GoldMine Discussion and Support Community

ContactReview Forum Index » GoldBox » Expression Not Functioning (Nested IIF)
Post new topic  Reply to topic View previous topic :: View next topic 
Expression Not Functioning (Nested IIF)
PostPosted: Mon Mar 28, 2011 10:45 am Points: 0 Reply with quote
davidshq
GoldMine Journeyman
Joined: 15 Jun 2010
Posts: 38




We have a field called UCOMMOK. This can contain variations of the values M, P, E. Based on what is on our source file we want to change what shows in the GM database. I've created the following expression, but it seems to always return blank rather than some variation of MPE:
IIF(TX->Disp="Fax/Modem".OR.TX->Disp="Language Barrier".OR.TX->Disp="Max Attempts".OR.TX->Disp="Wrong Number", IIF(Tgt->UCOMMOK="MPE", "ME", IIF(Tgt->UCOMMOK="MP", "M", IIF(Tgt->UCOMMOK="PE", "E", Tgt->UCOMMOK))), Tgt->UCOMMOK)
Essentially, this says if any of x conditions are true then perform y based on which x is true, otherwise just show original value.
Dave.
View user's profile Send private message

PostPosted: Mon Mar 28, 2011 1:07 pm Points: 0 Reply with quote
BobTaylor
GoldBox Guru
Joined: 07 Sep 2007
Posts: 1216
Location: Jacksonville, FL




When you get into areas like this, where it's not possible for me to test your expressions because I don't have the source file or fields you have, nor the GoldMine fields that you have, you are getting to the point where this venue is impractical, and consulting may be appropriate.

I believe I understand what you are trying to accomplish, and I don't see an obvious error in your expression. You might try negating the condition so you can use more traditional logic form (where the nesting is done on the "N" part of the expression), like

IIF(.NOT.(TX->Disp="Fax/Modem".OR.TX->Disp="Language Barrier".OR.TX->Disp="Max Attempts".OR.TX->Disp="Wrong Number"), Tgt->UCOMMOK, IIF(Tgt->UCOMMOK="MPE", "ME", IIF(Tgt->UCOMMOK="MP", "M", IIF(Tgt->UCOMMOK="PE", "E", Tgt->UCOMMOK))))

but I can't test it, so I don't know if it will help (or even if I actually have it right). Also, I'd convert the source file references to GXI references, but again, I don't know if that will help.

On the other hand, it looks to me like an IIF statement that utilizes a GXTranslate would probably get the job done. Just make a specific sub-table of GXTranslate for this purpose.

PS, just realized that I failed to mention that the reference to TGT means that you could only use the expression as an Update. I'd probably change it so you could use it as an Import expression, and then use the Update option "GXI Filled".

_________________
Bob Taylor
Bob Taylor Consulting
(904)646-9861
www.goldboxbob.com
Consulting with GoldBox and GoldMine since 1997.
View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Mar 29, 2011 1:49 pm Points: 0 Reply with quote
davidshq
GoldMine Journeyman
Joined: 15 Jun 2010
Posts: 38




I got it working. I did what you suggested and separated it into an import and update expression. In the import expression I set GXI->UCOMMOK to Y if it was any of those values, then in the update expression if GXI->UCOMMOK was Y I ran the nested IIF's to get the current TGT->UCOMMOK and remove P from it.
Thanks!
Dave.
View user's profile Send private message

PostPosted: Tue Mar 29, 2011 2:02 pm Points: 0 Reply with quote
BobTaylor
GoldBox Guru
Joined: 07 Sep 2007
Posts: 1216
Location: Jacksonville, FL




Looks like you 're getting the feel for it.

_________________
Bob Taylor
Bob Taylor Consulting
(904)646-9861
www.goldboxbob.com
Consulting with GoldBox and GoldMine since 1997.
View user's profile Send private message Send e-mail Visit poster's website

Expression Not Functioning (Nested IIF)
  ContactReview Forum Index » GoldBox
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  


Brought to you by Castell Computers, Doug Castell, Admin
RSS Feed
Powered by phpBB © 2001-2004 phpBB Group
Theme created by Vjacheslav Trushkin