I have a report that is published monthly and I use the data from this report to generate a sub-report. The data set below is a compilation of 4 months of reports and has overall filter, which I apply when I pull the data together. This is also a truncated and slightly masked data set, but the logic will be consistent.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Period[/TD]
[TD]Month_Rank[/TD]
[TD]Con#[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201809[/TD]
[TD]1[/TD]
[TD]CON1[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201809[/TD]
[TD]1[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201809[/TD]
[TD]1[/TD]
[TD]CON3[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201810[/TD]
[TD]2[/TD]
[TD]CON1[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201810[/TD]
[TD]2[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201810[/TD]
[TD]2[/TD]
[TD]CON4[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201811[/TD]
[TD]3[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201811[/TD]
[TD]3[/TD]
[TD]CON5[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201812[/TD]
[TD]4[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201812[/TD]
[TD]4[/TD]
[TD]CON6[/TD]
[TD]Unique[/TD]
[/TR]
</tbody>[/TABLE]
Period: Manually entered based on the month the report was pulled.
Month_Rank: Formula calculation =TRUNC(SUMPRODUCT(--([@[Period]] > [Period])/COUNTIF([Period],[Period]))+1,1)
Con#: Data from the monthly report
Unique: Formula calculation =IF(COUNTIF([Con#],[@[Con#]])=1,"Unique","Duplicate")
Assume 201812 is the most current period.
Objective 1: Count the "Con#"s that exists in the previous period AND does NOT exist in the current period.
Example: The count for the table above would be 1. CON5 exists in "Month_Rank" = 3, but not "Month_Rank" = 4. It does not matter if it exists in even earlier periods.
I am having trouble with the logic since it is counting the "Con#" column based on two sets of criteria from "Month_Rank". Any help or guidance would be greatly appreciated.
Please let me know if I need to clarify further.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Period[/TD]
[TD]Month_Rank[/TD]
[TD]Con#[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201809[/TD]
[TD]1[/TD]
[TD]CON1[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201809[/TD]
[TD]1[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201809[/TD]
[TD]1[/TD]
[TD]CON3[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201810[/TD]
[TD]2[/TD]
[TD]CON1[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201810[/TD]
[TD]2[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201810[/TD]
[TD]2[/TD]
[TD]CON4[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201811[/TD]
[TD]3[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201811[/TD]
[TD]3[/TD]
[TD]CON5[/TD]
[TD]Unique[/TD]
[/TR]
[TR]
[TD]201812[/TD]
[TD]4[/TD]
[TD]CON2[/TD]
[TD]Duplicate[/TD]
[/TR]
[TR]
[TD]201812[/TD]
[TD]4[/TD]
[TD]CON6[/TD]
[TD]Unique[/TD]
[/TR]
</tbody>[/TABLE]
Period: Manually entered based on the month the report was pulled.
Month_Rank: Formula calculation =TRUNC(SUMPRODUCT(--([@[Period]] > [Period])/COUNTIF([Period],[Period]))+1,1)
Con#: Data from the monthly report
Unique: Formula calculation =IF(COUNTIF([Con#],[@[Con#]])=1,"Unique","Duplicate")
Assume 201812 is the most current period.
Objective 1: Count the "Con#"s that exists in the previous period AND does NOT exist in the current period.
Example: The count for the table above would be 1. CON5 exists in "Month_Rank" = 3, but not "Month_Rank" = 4. It does not matter if it exists in even earlier periods.
I am having trouble with the logic since it is counting the "Con#" column based on two sets of criteria from "Month_Rank". Any help or guidance would be greatly appreciated.
Please let me know if I need to clarify further.