Seven Stars

Comparison calculation for price variation check

Hi Talend Folks,

 

Check the Yesterday Price with Today Price. if today's price is more than 5% of Yesterdays Price then i need to set below values

"Not Ok" else "Ok'

 

How to write query for above scenario.

I tried but i don't know logic is correct or wrong. could please tell me ?

 

row1. Today_Price  >(row1. Yesterday_Price *0.05)? "Not OK" : "OK"

3 REPLIES
Twelve Stars

Re: Comparison calculation for price variation check

The expression looks OK to me. Have you tried it? The only thing I can think that could cause problems is if either "Today_Price" or "Yesterday_Price" is null

Rilhia Solutions
Ten Stars

Re: Comparison calculation for price variation check

Are you sure the requirement is to check if the price is more than 5% of yesterday's price and not a change of more than 5%?

Seven Stars

Re: Comparison calculation for price variation check

Ya Sure.