This topic contains 3 replies, has 0 voices, and was last updated by eleran 8 years, 8 months ago.

  • Author
    Posts
  • #5344

    eleran

    I am writing a saved search to look at return authorizations. I want it to display all of them based on a date range. I know how to do everything but one tricky part.

    We have a selection of description items that the people creating the RAs are supposed to use to explain the reason for return. there are 7 description items in all. I can get the criteria to find the return auths. What I need is a formula that will display the reason for return description item used or show none if someone failed to use one of the pre-made desc items. I am having trouble with the syntax for the CASE WHEN statement, if that is even the best way to go.

    Basically, I want it to say if one of these items is used print the name of the item used, if none of these were used print the word NONE

    Any insight would be invaluable.
    This is a cached copy. Click here to see the original post.

  • #5345

    Olivier Gagnon NC

    It’s a bit more complicated than a case when.

    So, your search will need to return all lines (mainline false).

    For each line, add a formula something like CASE WHEN {item.id} IN (123,456,789,…) THEN {description} ELSE ” END

    Then group all other field (assuming they are all body fields, thus the same for all lines), and use MAX on this formula. The multiple lines will squish, and you’ll be left with the description if there is one.

    NOTE: I don’t think I actually ever tried using “IN”, not sure in actually works.

    Sorry, these explanations are not super complete but I don’t have the time today to run through it in detail. Give this a shot, if it doesn’t work post back and I’ll try to find more time in the coming days to go over it in more detail.

  • #5346

    michoel

    We have a selection of description items that the people creating the RAs are supposed to use to explain the reason for return. there are 7 description items in all. I can get the criteria to find the return auths.

    If it’s not too late to change, a better option might be to create a custom field with a list of return reasons. In addition to making the reporting easier, it also gives you the ability to make the field mandatory.

  • #5347

    eleran

    Originally posted by michoel

    View Post

    If it’s not too late to change, a better option might be to create a custom field with a list of return reasons. In addition to making the reporting easier, it also gives you the ability to make the field mandatory.

    That is brilliant. Thanks for the inspiration. I will let you know how that turns out.

You must be logged in to reply to this topic.