Skip to main content
Solved

Conditional value doesn't work properly ?

  • February 15, 2017
  • 3 replies
  • 76 views

lifalin2016
Supporter
Forum|alt.badge.img+39

Hi,

 

 

I've just run into a curious problem with a conditional expression in the AttributeManager.?

 

 

I'm comnparing two dates in the "FME Date" format (%Y%m%d), setting an "expired" value to either "true" or "false" based on the conditional expression: @Value(dt1) > @Value(dt2)

 

 

But it seems like the expression is always satisfied, so my output is always "true", regardless of the values involved (and some should definitely yield "false").

 

 

As a workaround I added a Tester transformer, with the exact same expression, and that worked as expected.

 

 

Has anyone else run into this, or have any insight into why the conditional value errs ?

 

 

Cheers

Best answer by takashi

Hi @lifalin2016, you have renamed "col2" to "CreatedDate" before setting "Expired".

"col2" has been missing after renaming, and a missing attribute will be interpreted as an empty string in test clauses. I think it's the reason why "Expired" became always "true".

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

lifalin2016
Supporter
Forum|alt.badge.img+39
  • Author
  • Supporter
  • February 15, 2017

Here's a sample workspace that illustrates the problem:

condional-value-error.fmw


takashi
Celebrity
  • Best Answer
  • February 15, 2017

Hi @lifalin2016, you have renamed "col2" to "CreatedDate" before setting "Expired".

"col2" has been missing after renaming, and a missing attribute will be interpreted as an empty string in test clauses. I think it's the reason why "Expired" became always "true".


lifalin2016
Supporter
Forum|alt.badge.img+39
  • Author
  • Supporter
  • February 15, 2017

Hi @lifalin2016, you have renamed "col2" to "CreatedDate" before setting "Expired".

"col2" has been missing after renaming, and a missing attribute will be interpreted as an empty string in test clauses. I think it's the reason why "Expired" became always "true".

Doh!

 

 

Grrr. Why in %¤#/& does it provide me with "col2" if it's renamed?? The value was inserted by simple point and click, so the interface is unfortunately not as user friendly as it ought to be.

 

 

Thanks Takashi.