dcsimg
Results 1 to 3 of 3

Thread: [RESOLVED] SQL Need to some help with this challenge

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    362

    Resolved [RESOLVED] SQL Need to some help with this challenge

    Hi
    I have a big problem which I spent two days on with no apparent result.
    I need to define two states for each cases. Here is the story; I have a table containing the phase tracks of some cases. All cases start with “New” phase. If the case has been in “Approval” and then back to “New” the case has not been RFT (right first time). Otherwise they are RFT. So somehow I need to check if cases have been in “Approval” and then back to “New”. I thought of looping through each phase for each case and then do something when I see that pattern (going back from Approval to New). But then I thought nothing more

    Here are the tables:

    Name:  2019-04-14_16-53-30.jpg
Views: 65
Size:  50.9 KB

    I need the RFT column in table 2 to reflect the result.

    Any help is appreciated.
    Thanks in advance.
    Last edited by Grand; Apr 14th, 2019 at 11:22 AM.

  2. #2
    Fanatic Member
    Join Date
    Nov 2017
    Posts
    824

    Re: SQL Need to some help with this challenge

    For each CaseID

    Find the highest value of Phase Order where Phase = "New", store that in A
    Find the lowest value of Phase Order where Phase = "Approval", store that in B

    If A > B then it went from Approval back to New, so do your thing.

    Sorry, I can't provide actual SQL code. Good luck.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    362

    Re: SQL Need to some help with this challenge

    Thanks. I see that I have not explained what I actually wanted. I will close this thread and open a new one with the correct inquiry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width