Forum Discussion
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_Month | Part# |
| 2014-03 | CCH057169 |
| 2014-03 | CCH057276 |
| 2014-03 | CCH057303 |
| 2014-03 | CCH057430 |
| 2014-04 | CCH057409 |
| 2014-04 | CCH057497 |
| 2014-04 | CCH057570 |
| 2014-04 | CCH057583 |
| 2014-04 | CCH057650 |
| 2014-04 | CCH057696 |
| 2014-04 | CCH057707 |
| 2014-04 | CCH057798 |
| 2014-05 | CCH057701 |
| 2014-06 | CCH057235 |
| 2014-06 | CCH057280 |
| 2014-06 | CCH057693 |
| 2014-06 | CCH057707 |
| 2014-06 | CCH057721 |
| 2014-07 | CCH057235 |
| 2014-07 | CCH057427 |
| 2014-08 | CCH057650 |
| 2014-08 | CCH057696 |
| 2014-08 | CCH057798 |
| 2014-09 | CCH057303 |
| 2014-09 | CCH057482 |
| 2014-09 | CCH057668 |
| 2014-09 | CCH057744 |
| 2014-09 | CCH057776 |
| 2014-10 | CCH057668 |
| 2014-10 | CCH057696 |
| 2014-11 | CCH057390 |
| 2014-11 | CCH057409 |
| 2014-11 | CCH057679 |
| 2014-11 | CCH057700 |
| 2014-11 | CCH057721 |
| 2014-11 | CCH057749 |
| 2014-11 | CCH057896 |
| 2014-12 | CCH057169 |
| 2014-05 | CCH057693 |
| 2014-12 | CCH057696 |
| 2014-12 | CCH057708 |
| 2014-12 | CCH057876 |
| 2014-12 | CCH057896 |
| 2015-01 | CCH057630 |
| 2015-01 | CCH057679 |
| 2015-01 | CCH057700 |
| 2015-01 | CCH057776 |
| 2015-02 | CCH057409 |
| 2015-02 | CCH057482 |
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_Month | Part# |
| 2014-06 | CCH057235 |
| 2014-06 | CCH057280 |
| 2014-06 | CCH057707 |
| 2014-06 | CCH057721 |
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
Solution 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_Month Part# 2014-03 CCH057169 2014-03 CCH057276 2014-03 CCH057303 2014-03 CCH057430 2014-04 CCH057409 2014-04 CCH057497 2014-04 CCH057570 2014-04 CCH057583 2014-04 CCH057650 2014-04 CCH057696 2014-04 CCH057707 2014-04 CCH057798 2014-05 CCH057701 2014-06 CCH057235 2014-06 CCH057280 2014-06 CCH057693 2014-06 CCH057707 2014-06 CCH057721 2014-07 CCH057235 2014-07 CCH057427 2014-08 CCH057650 2014-08 CCH057696 2014-08 CCH057798 2014-09 CCH057303 2014-09 CCH057482 2014-09 CCH057668 2014-09 CCH057744 2014-09 CCH057776 2014-10 CCH057668 2014-10 CCH057696 2014-11 CCH057390 2014-11 CCH057409 2014-11 CCH057679 2014-11 CCH057700 2014-11 CCH057721 2014-11 CCH057749 2014-11 CCH057896 2014-12 CCH057169 2014-12 CCH057693 2014-12 CCH057696 2014-12 CCH057708 2014-12 CCH057876 2014-12 CCH057896 2015-01 CCH057630 2015-01 CCH057679 2015-01 CCH057700 2015-01 CCH057776 2015-02 CCH057409 2015-02 CCH057482 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.
- AnonymousNot 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
Solution Sage
Hi Raj,
It is there, The Data is not sorted.
- AnonymousNot 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