I have 3 fields that capture a number value. I would like to find the lowest value of the 3 fields (not null AND not 0). I created a SIL script to do this - however it assumes all 3 fields have a value. Truth is that not all fields are required so they may not have a value. Here is my script:
number QuotationV1 = #{Quotation 1 Total Value};
number QuotationV2 = #{Quotation 2 Total Value};
number QuotationV3 = #{Quotation 3 Total Value};
if (QuotationV1 != 0 && isNotNull(QuotationV1)) {
if ((QuotationV1 < QuotationV2) && (QuotationV1 < QuotationV3)) {
#{Lowest Bid Cost number} = #{Quotation 1 Total Value};
#{Lowest Bidder} = #{Quotation 1 Vendor};
}
}
else {
if (QuotationV2 != 0 && isNotNull(QuotationV2)) {
if (QuotationV2 < QuotationV1 && QuotationV2 < QuotationV3) {
#{Lowest Bid Cost number} = #{Quotation 2 Total Value};
#{Lowest Bidder} = #{Quotation 2 Vendor};
}
}
else {
if (QuotationV3 != 0 && isNotNull(QuotationV3)) {
if (QuotationV3 < QuotationV1 && QuotationV3 < QuotationV2) {
#{Lowest Bid Cost number} = #{Quotation 3 Total Value};
#{Lowest Bidder} = #{Quotation 3 Vendor};
}
}
}
}
Hoping someone can see a obvious solution.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.