Solved

Conditional value doesn't work properly ?

  • 15 February 2017
  • 3 replies
  • 11 views

Userlevel 1
Badge +22

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
icon

Best answer by takashi 15 February 2017, 12:10

View original

3 replies

Userlevel 1
Badge +22

Here's a sample workspace that illustrates the problem:

condional-value-error.fmw

Userlevel 2
Badge +17

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

Userlevel 1
Badge +22

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.

 

Reply