Forum Discussion

rocky09's avatar
rocky09
Icon for Solution Sage rankSolution Sage
8 years ago

Comparing Data Between Two Dates from Single Table and show New Records from the Recent Date Range

I have this following table. I need to find a way to compare the data between two given dates (Year & Month format)  and show New Records from the Recent Date . (see below example and data)

 

Year_MonthPart#
2014-03CCH057169
2014-03CCH057276
2014-03CCH057303
2014-03CCH057430
2014-04CCH057409
2014-04CCH057497
2014-04CCH057570
2014-04CCH057583
2014-04CCH057650
2014-04CCH057696
2014-04CCH057707
2014-04CCH057798
2014-05CCH057701
2014-06CCH057235
2014-06CCH057280
2014-06CCH057693
2014-06CCH057707
2014-06CCH057721
2014-07CCH057235
2014-07CCH057427
2014-08CCH057650
2014-08CCH057696
2014-08CCH057798
2014-09CCH057303
2014-09CCH057482
2014-09CCH057668
2014-09CCH057744
2014-09CCH057776
2014-10CCH057668
2014-10CCH057696
2014-11CCH057390
2014-11CCH057409
2014-11CCH057679
2014-11CCH057700
2014-11CCH057721
2014-11CCH057749
2014-11CCH057896
2014-12CCH057169
2014-05CCH057693
2014-12CCH057696
2014-12CCH057708
2014-12CCH057876
2014-12CCH057896
2015-01CCH057630
2015-01CCH057679
2015-01CCH057700
2015-01CCH057776
2015-02CCH057409
2015-02CCH057482

 

I have slicer to select two Dates lets say,

RecentMonth    2014-06    
Previous_Month    2014-05 

 

I want to see the results like this.

Year_MonthPart#
2014-06CCH057235
2014-06CCH057280
2014-06CCH057707
2014-06CCH057721

 

see the Part# CCH057693 is common in both Date range. So, I don't want this to show in the Visual Table .  Any Idea? I am really stuck with this one.

6 Replies

  • rocky09's avatar
    rocky09
    Icon for Solution Sage rankSolution Sage

    I have this following data in a single table. I need to split this table into multiple tables based on the YearMonth Column. Is there a way to automate this task.

     

    Year_MonthPart#
    2014-03CCH057169
    2014-03CCH057276
    2014-03CCH057303
    2014-03CCH057430
    2014-04CCH057409
    2014-04CCH057497
    2014-04CCH057570
    2014-04CCH057583
    2014-04CCH057650
    2014-04CCH057696
    2014-04CCH057707
    2014-04CCH057798
    2014-05CCH057701
    2014-06CCH057235
    2014-06CCH057280
    2014-06CCH057693
    2014-06CCH057707
    2014-06CCH057721
    2014-07CCH057235
    2014-07CCH057427
    2014-08CCH057650
    2014-08CCH057696
    2014-08CCH057798
    2014-09CCH057303
    2014-09CCH057482
    2014-09CCH057668
    2014-09CCH057744
    2014-09CCH057776
    2014-10CCH057668
    2014-10CCH057696
    2014-11CCH057390
    2014-11CCH057409
    2014-11CCH057679
    2014-11CCH057700
    2014-11CCH057721
    2014-11CCH057749
    2014-11CCH057896
    2014-12CCH057169
    2014-12CCH057693
    2014-12CCH057696
    2014-12CCH057708
    2014-12CCH057876
    2014-12CCH057896
    2015-01CCH057630
    2015-01CCH057679
    2015-01CCH057700
    2015-01CCH057776
    2015-02CCH057409
    2015-02CCH057482

     

    OR:

    More Information:

    I am getting the data from Oracle Database. The Purpose of this data is to compare between two given Dates and provide new records. Is there a way that I select two dates on the form (Slicer) and then the query has to fetch the data based on the date selection on the form.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi

    I understand the common value should be filtered, but I see CCH057701 value for 2014-05 in teh source data but missing in the output. Could you pls explain your requirement?

     

    Thanks
    Raj

    • rocky09's avatar
      rocky09
      Icon for Solution Sage rankSolution Sage

      Hi Raj,

       

      It is there, The Data is not sorted.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi

         

        Could you pls try this?

         

        1. Create a column unsing RANDBETWEEN as shown below:

        cnt = RANDBETWEEN(1,count(DateSlicer[Part#]))

        2. Use the below RANKX and filter the duplicate as needed.

        Numbering = RANKX(FILTER (DateSlicer,DateSlicer[Part#]=EARLIER(DateSlicer[Part#])),DateSlicer[cnt]) 

         

        Thanks
        Raj