FlowHeater Logo

FlowHeater Support Forum

simply more productive

Download the freeware version (10 Mb)

Up to 100,000 records can be processed with the freeware version!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: If-then-else for another field

If-then-else for another field 2 weeks 4 days ago #3393

  • Richard Barnett
  • Richard Barnett's Avatar Topic Author
  • Offline
  • Posts: 6
Hi.
I am having trouble finding an example of an if-then-else where the if query relates to a different field. So my data is something like this

SKU Brand Price
123 Brother $100
124 Epson $110
125 Epson $120
126 HP $130
So I want to calculate
IF Brand = Epson then Multiply Price by .99 and
IF Brand = HP then Multiply Price by .98
else keep the same price.

Can you help with this?
Thank you

Please Log in or Create an account to join the conversation.

If-then-else for another field 2 weeks 4 days ago #3394

Hi Richard,

You have to use a Condition chain. The First IF-THEN-ELSE Condition just have the rule “Brand” = HP. Wether is YES the calculatet values goes out in case of NO the original value are the result. The second IF-THEN-ELSE Condition use the rule “Brand” = Epson. In case of yes the price will be calculate in case of NO the value form the first condition will be used. That´s all.

Attached you´ll find an example how it´s work. In the example I also used the .NET Script Heater and a little script.

Here you´ll find two more detailed examples:
Simple If-Then-Else example
Complex If-Then-ElseIf example




File Attachment:

File Name: calc-condition.zip
File Size: 3 KB
Attachments:

Please Log in or Create an account to join the conversation.

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.

If-then-else for another field 2 weeks 1 day ago #3395

  • Richard Barnett
  • Richard Barnett's Avatar Topic Author
  • Offline
  • Posts: 6
Hi there.
Thanks very much for that. Once I set up the New Price field it all worked great.
The .NET script version works fine too - this .NET version is easy to add other brands if I wish.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.777 seconds