none
Identify Increasing or Decreasing Trend RRS feed

  • Question

  • Hi All,

    I have data like
    EmpID Salary Paid Date Salary Paid
    100 628 1/11/2019
    100 1086 1/25/2019
    100 1055 2/8/2019
    100 981 2/22/2019
    100 653 3/8/2019
    100 871 3/22/2019
    100 385 4/18/2019
    101 2032 1/4/2019
    101 3466 1/18/2019
    101 2652 2/1/2019
    101 2013 4/26/2019



    Is there any way identify a "Trend Decreasing" flag (Yes/ No). only one record or preferably decision on "Decreasing" can be repeat for all the rows. something like

    EmpID Salary Paid Date Salary Paid Decreasing Flag
    100 628 1/11/2019 Y
    100 1086 1/25/2019 Y
    100 1055 2/8/2019 Y
    100 981 2/22/2019 Y
    100 653 3/8/2019 Y
    100 871 3/22/2019 Y
    100 385 4/18/2019 Y
    101 2032 1/4/2019 N
    101 3466 1/18/2019 N
    101 2652 2/1/2019 N
    101 2013 4/26/2019 N


    Y/N is the valued for each empid (not for each row)

    Thanks
    Friday, July 19, 2019 3:48 PM

All replies

  • Hi RishN,

    How is trend analysis is SSIS related?

    A typical approach is to use any of the graphing/charting tools.

    Order by date, salary, group by employee and build a scatterplot.


    Arthur

    MyBlog


    Twitter

    Friday, July 19, 2019 4:56 PM
  • Sorry, I just realized that it's in wrong place. I need to move this from here. Thanks
    Friday, July 19, 2019 5:19 PM
  • Hi Arthur, can not find a way to delete or move to another place. Can you please guide me
    Friday, July 19, 2019 5:21 PM
  • Hi RoshN,

    I have moved this thread to T-SQL forum, please follow it there, thanks in advance!


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, July 22, 2019 1:39 AM
    Moderator
  • We would need to know what the rules are to define a trend as decreasing or not. In your example, why would the flag be Y for Empid = 100 and N for 101?


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Monday, July 22, 2019 7:51 AM
  • HI 

    Could you increase example data. Example for 4 different employeeId. I don't complectly understand.

    Monday, July 22, 2019 7:59 AM
  • Hi RoshN,

    I'm confused about your output:

    1) for empid 100, why decreasing flay is 'Y' when salary paid is from 628 to 1086 ? Same thing for the following rows.

    2) What do you mean of " Y/N is the valued for each empid (not for each row)'' 

    Can you explain your logic in details so that we are able to help? 

    Sabrina 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 22, 2019 8:03 AM
  • Hi RoshN,

    I am writing to follow up this thread with you. Have you solved your issue? If you have solved your issue ,in order to close this thread, please kindly mark helpful replies as answers. By doing so, it will benefit all community members who are having this similar issue.  Your contribution is highly appreciated.

     

    Regards,

    Sabrina


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 25, 2019 7:25 AM