Skip to main content
simply more productive

The Data Specialist

Thanks to our intuitive transformation designer, you can convert data effortlessly to a variety of formats without knowing how to program. It’s not only efficient, it’s also easy to use.
Flowheater Download

If-then-else for another field

  • Richard Barnett
  • Topic Author
  • Offline
  • User
  • User
More
6 years 4 months ago #3393 by Richard Barnett
If-then-else for another field was created by Richard Barnett
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 to join the conversation.

More
6 years 4 months ago #3394 by FlowHeater-Team
Replied by FlowHeater-Team on topic If-then-else for another field
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

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.
Attachments:

Please Log in to join the conversation.

  • Richard Barnett
  • Topic Author
  • Offline
  • User
  • User
More
6 years 4 months ago #3395 by Richard Barnett
Replied by Richard Barnett on topic If-then-else for another field
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 to join the conversation.

Time to create page: 0.341 seconds

FlowHeater - The Data Specialist

Efficient data integration and transformation with FlowHeater – the perfect solution for a seamless transfer of your data.

Rechtliches

Support & Contact

Kontaktinformation

Telefon:0951 / 99339792 E-Mail:This email address is being protected from spambots. You need JavaScript enabled to view it.

Copyright © 2009-2024 by FlowHeater GmbH. All rights reserved.