Skip to main content
Solved

Conditional value doesn't work properly ?

  • February 15, 2017
  • 3 replies
  • 51 views

lifalin2016
Contributor
Forum|alt.badge.img+29

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".

View original
Did this help you find an answer to your question?

3 replies

lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • February 15, 2017

Here's a sample workspace that illustrates the problem:

condional-value-error.fmw


takashi
Influencer
  • 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
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • February 15, 2017
takashi wrote:

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings