This topic contains 3 replies, has 0 voices, and was last updated by eleran 8 years, 7 months ago.
-
AuthorPosts
-
eleran- Contributions: 0
- Level 1
- ☆
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. -
Olivier Gagnon NC- Contributions: 0
- Level 1
- ☆
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.
-
michoel- Contributions: 0
- Level 1
- ☆
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.
-
eleran- Contributions: 0
- Level 1
- ☆
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.
-
AuthorPosts
You must be logged in to reply to this topic.