Comparing the previous value of channel with the current value of same channel Forum Home › Forums › Understanding the Software › Using Formulas › Comparing the previous value of channel with the current value of same channel This topic has 4 replies, 2 voices, and was last updated 6 years, 3 months ago by Mikhail. Viewing 5 posts - 1 through 5 (of 5 total) Author Posts December 25, 2017 at 7:55 am #2976 miteshParticipant Hi, I want compare previous value of channel-1 with the current value of channel-1.. and after comparison i want to store the highest value. (pre_data_cha1 > cur_data_cha1) ? pre_data_cha1 : cur_data_cha1 December 25, 2017 at 12:18 pm #2977 MikhailModerator Hi, Val() > Cnl ? Val() : Cnl This reply was modified 6 years, 3 months ago by Mikhail. December 29, 2017 at 9:33 am #2984 miteshParticipant Thank you Mikhail 🙂 January 2, 2018 at 5:30 am #3000 miteshParticipant Hello Mikhail, I want compare previous value of channel-1 with the current value of channel-1.. and after comparison i want to store the highest value. (pre_data_cha1 > cur_data_cha1) ? pre_data_cha1 : cur_data_cha1. I got answer for this by your reply Val() > Cnl ? Val() : Cnl. now i want to save that highest value in excel sheet with time. how to show time in excel sheet. January 2, 2018 at 7:45 am #3002 MikhailModerator Hi, If you need to save a time when value is maximum, you need additional channel and more complex formula. Something like that: double GetMax(int timeCnl) { if (Val() > Cnl) { return Val(); } else { SetVal(timeCnl, EncodeDate(DateTime.Now)); return Cnl; } } You should read about Elastic Report: http://doc.rapidscada.net/content/en/modules/plg-elastic-report.html The demo is here http://demo.rapidscada.net/plugins/ElasticReport/ElasticRep.aspx?reportID=101 In case of questions about Elastic Report, create a new topic. Author Posts Viewing 5 posts - 1 through 5 (of 5 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In