This topic contains 4 replies, has 2 voices, and was last updated by Ian Ford 6 years, 3 months ago.

  • Author
    Posts
  • #26043

    Ian Ford
    Member
    @ian_ford

    What I am trying to accomplish is to display orders that meet the following criteria.
    1. item.class = ‘Accessories’

    2. item.class = ‘Footwear’

    3. item.class != ‘Assembly’

    Current Case Statement:
    CASE WHEN

    ({item.class} = ‘Accessories’ And {item.class} != ‘Assembly’)

    Or ({item.class} = ‘Footwear’ And {item.class} != ‘Assembly’)

    THEN 1 ELSE 0 END

    This works to a point it gives me the SO’s that have the required items based off their class but what I am really trying to achieve is if the SO has an item that meets these criteria and an item that does not it should not display the SO on in the saved search. Currently that is the part I am struggling to figure out.

    Thank you,

    • This topic was modified 6 years, 3 months ago by Ian Ford.
  • #26045

    Adolfo Garza
    Member
    @adolfo_garza

    Can you please confirm what you need? I am confused by the first 3 criterias in your post, do all 3 of them need to match? I think it would be helpful if you provide an scenario and then provide a table of what you would like to see in your search results.

  • #26046

    Ian Ford
    Member
    @ian_ford

    Basically I need this.

    If item.class != ‘Assembly’ then return 0

    What I want on the SS is to only display orders with items that do not require Assembly. As we get multiple orders over the course of the day we do get orders that contain items with Assembly and also contain items that don’t require Assembly these types of orders I do not want to display in the SS results.

    As far as what I should see in the SS this would be the format.
    SO, Date Ordered, Total Value

    Not much else the reason for this is so that we can send these particular orders to a different area of the company to fullfill and send the orders with Assembly items to another (yeah kind of silly but this is what I have been asked for)

    • This reply was modified 6 years, 3 months ago by Ian Ford.
  • #26048

    Adolfo Garza
    Member
    @adolfo_garza

    Do it the other way around. If the order includes an Assembly item then set the result to 1, else 0, then exclude anything over 0.

    Column:
    Field: Formula(Numeric)
    Formula: CASE {item.class} WHEN ‘Assembly’ THEN 1 else 0 END
    SummaryType: Sum

    Then use a summary filter to define that you want to include only those where the sum is 0:
    Field: Formula(Numeric)
    Formula: CASE {item.class} WHEN ‘Assembly’ THEN 1 else 0 END
    SummaryType: Sum

    • This reply was modified 6 years, 3 months ago by Adolfo Garza.
    • This reply was modified 6 years, 3 months ago by Adolfo Garza.
  • #26051

    Ian Ford
    Member
    @ian_ford

    Actually I figured out that a SS via the UI was not going to give exactly what I was looking for so I decided to just create a suitescript and its working as intended.

    Thank you for the help.

You must be logged in to reply to this topic.