0

Multiple Choice in nested if formula

Help please - I have a multiple-choice and want to create text from it. When a region is selected it must form part of the text. But with the formula when the first selection is not chosen it does not show any of the other selections in the result. Also, none of the selections after a region that is not chosen does show.

Screen Shot 2020-01-28 at 9.15.02 AM

 

'Note Price Export' := if 'Note Price' = true then
if text(chosen('EVG Sales Regions')) = "UK" then
"The " + 'Marque Brand' + " " + 'WEV Model Name' + " sells in the UK from " + 'GB MSRP (before incentives & destination)' + ". "
end
else
if text(chosen('EVG Sales Regions')) = "USA" then
"The " + 'Marque Brand' + " " + 'WEV Model Name' + " sells in the USA from " + 'US MSRP (before incentives & destination)' + ". "
end + if text(chosen('EVG Sales Regions')) = "Europe" then
"The " + 'Marque Brand' + " " + 'WEV Model Name' + " sells in Europe from " + 'EU MSRP (before incentives & destination)' + ". "
end
end

11 replies

null
    • Sean
    • 4 yrs ago
    • Reported - view

    It looks like you should be using a Choice field instead of a Multiple Choice field since you are testing for only one of 8+ possible selections. You are missing an "else" after the "USA" test and before the "Europe" test, but I suggest you look at this thread for another possible solution...

     

    https://ninoxdb.de/en/forum/technical-help-5ab8fe445fe2b42b7dd39ee7/why-is-my-switch-statement-always-returning-the-default-value.-5e207c2429d23b76717ef4f4?post=5e300b7c3e75fd2f4513f81f&page=1

    • wynand
    • 4 yrs ago
    • Reported - view

    Thanks, bad example - there could be more than one possibility so unfortunately, I have to go with multiple choice

    • Sean
    • 4 yrs ago
    • Reported - view

    I suppose it depends on what you choose to focus on. I would still use a switch statement, especially considering the quantity of possible choices.

    • Sean
    • 4 yrs ago
    • Reported - view

    I got a chance to look at what you posted on my computer instead of my phone. In the image I show what you have and below that a corrected version.

     

    Screen Shot 2020-01-29 at 11.51.15 PM

     

    I would still use a switch statement though.

    • New_Sun
    • 4 yrs ago
    • Reported - view

    Where to write this formula?

    • Sean
    • 4 yrs ago
    • Reported - view

    If you are modifying a Field it would need to go in a Trigger or a Button

    • wynand
    • 4 yrs ago
    • Reported - view

    Thanks, Sean, I tried to get videos on switch statements but it seems it works with choice and not multiple-choice as required in this case.

    • Sean
    • 4 yrs ago
    • Reported - view

    Wynand, It will work with a switch statement. Below is a short example of all the possible choice combinations, just modify to suit your needs.

     

    switch concat(chosen(Country)) do
    case "Europe":
    "Europe"
    case "UK":
    "UK"
    case "USA":
    "USA"
    case "Canada":
    "Canada"
    case "Australia":
    "Australia"
    case "New Zealand":
    "New Zealand"
    case "China":
    "China"
    case "Norway":
    "Norway"
    case "Europe, UK":
    "Europe & UK"
    case "Europe, USA":
    "Europe & USA"
    case "Europe, Canada":
    "Europe & Canada"
    case "Europe, Australia":
    "Europe & Australia"
    case "Europe, New Zealand":
    "Europe & New Zealand"
    case "Europe, China":
    "Europe & China"
    case "Europe, Norway":
    "Europe & Norway"
    end

    • wynand
    • 4 yrs ago
    • Reported - view

    Thanks

    • wynand
    • 4 yrs ago
    • Reported - view

    @Sean thanks for introducing me to switch statements. I use it very effectively now

    • Sean
    • 4 yrs ago
    • Reported - view

    @Wynand, You're welcome. Glad you got it working.

Content aside

  • 4 yrs agoLast active
  • 11Replies
  • 2618Views