Share via


Excel.DateFilterCondition enum

Enumeración que representa todas las condiciones aceptadas por las que se puede aplicar un filtro de fecha. Se usa para configurar el tipo de PivotFilter que se aplica al campo.

Comentarios

[ Conjunto de API: ExcelApi 1.12 ]

Ejemplos

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/38-pivottable/pivottable-pivotfilters.yaml

await Excel.run(async (context) => {
  // Add a date-based PivotFilter.

  // Get the PivotTable.
  const pivotTable = context.workbook.worksheets.getActiveWorksheet().pivotTables.getItem("Farm Sales");

  // PivotFilters can only be applied to PivotHierarchies that are being used for pivoting.
  // If it's not already there, add "Date Updated" to the hierarchies.
  let dateHierarchy = pivotTable.rowHierarchies.getItemOrNullObject("Date Updated");
  await context.sync();
  if (dateHierarchy.isNullObject) {
    dateHierarchy = pivotTable.rowHierarchies.add(pivotTable.hierarchies.getItem("Date Updated"));
  }

  // Apply a date filter to filter out anything logged before August.
  const filterField = dateHierarchy.fields.getItem("Date Updated");
  const dateFilter = {
    condition: Excel.DateFilterCondition.afterOrEqualTo,
    comparator: {
      date: "2020-08-01",
      specificity: Excel.FilterDatetimeSpecificity.month
    }
  };
  filterField.applyFilter({ dateFilter: dateFilter });

  await context.sync();
});

Campos

after = "After"

La fecha es posterior a la fecha del comparador.

Criterios necesarios: {comparator}. Criterios opcionales: {wholeDays}.

afterOrEqualTo = "AfterOrEqualTo"

La fecha es posterior o igual a la fecha del comparador.

Criterios necesarios: {comparator}. Criterios opcionales: {wholeDays}.

allDatesInPeriodApril = "AllDatesInPeriodApril"

La fecha es en abril.

allDatesInPeriodAugust = "AllDatesInPeriodAugust"

La fecha es en agosto.

allDatesInPeriodDecember = "AllDatesInPeriodDecember"

La fecha es en diciembre.

allDatesInPeriodFebruary = "AllDatesInPeriodFebruary"

La fecha es en febrero.

allDatesInPeriodJanuary = "AllDatesInPeriodJanuary"

La fecha es en enero.

allDatesInPeriodJuly = "AllDatesInPeriodJuly"

La fecha es en julio.

allDatesInPeriodJune = "AllDatesInPeriodJune"

La fecha es en junio.

allDatesInPeriodMarch = "AllDatesInPeriodMarch"

La fecha es en marzo.

allDatesInPeriodMay = "AllDatesInPeriodMay"

La fecha es en mayo.

allDatesInPeriodNovember = "AllDatesInPeriodNovember"

La fecha es en noviembre.

allDatesInPeriodOctober = "AllDatesInPeriodOctober"

La fecha es en octubre.

allDatesInPeriodQuarter1 = "AllDatesInPeriodQuarter1"

La fecha es en el trimestre 1.

allDatesInPeriodQuarter2 = "AllDatesInPeriodQuarter2"

La fecha es en el trimestre 2.

allDatesInPeriodQuarter3 = "AllDatesInPeriodQuarter3"

La fecha es en el trimestre 3.

allDatesInPeriodQuarter4 = "AllDatesInPeriodQuarter4"

La fecha es en el cuarto trimestre.

allDatesInPeriodSeptember = "AllDatesInPeriodSeptember"

La fecha es en septiembre.

before = "Before"

La fecha es anterior a la fecha del comparador.

Criterios necesarios: {comparator}. Criterios opcionales: {wholeDays}.

beforeOrEqualTo = "BeforeOrEqualTo"

La fecha es anterior o igual a la fecha del comparador.

Criterios necesarios: {comparator}. Criterios opcionales: {wholeDays}.

between = "Between"

Entre lowerBound y upperBound fechas.

Criterios necesarios: {lowerBound, upperBound}. Criterios opcionales: {wholeDays, exclusive}.

equals = "Equals"

Es igual al criterio del comparador.

Criterios necesarios: {comparator}. Criterios opcionales: {wholeDays, exclusive}.

lastMonth = "LastMonth"

La fecha es el mes pasado.

lastQuarter = "LastQuarter"

La fecha es el último trimestre.

lastWeek = "LastWeek"

La fecha es la semana pasada.

lastYear = "LastYear"

La fecha es el año pasado.

nextMonth = "NextMonth"

La fecha es el mes siguiente.

nextQuarter = "NextQuarter"

La fecha es el próximo trimestre.

nextWeek = "NextWeek"

La fecha es la próxima semana.

nextYear = "NextYear"

La fecha es el año siguiente.

thisMonth = "ThisMonth"

La fecha es este mes.

thisQuarter = "ThisQuarter"

La fecha es este trimestre.

thisWeek = "ThisWeek"

La fecha es esta semana.

thisYear = "ThisYear"

La fecha es este año.

today = "Today"

La fecha es hoy.

tomorrow = "Tomorrow"

La fecha es mañana.

unknown = "Unknown"

DateFilterCondition es desconocido o no es compatible.

yearToDate = "YearToDate"

La fecha está en el mismo año hasta la fecha.

yesterday = "Yesterday"

La fecha es ayer.