Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Marc-Alexis
Frequent Visitor

actualización incremental basada en una fecha almacenada con el formato AAAAMMDD INT

Hola a todos,

Estoy tratando de activar la actualización incremental en una tabla "FMT_Reporting_V2V_GuestHistoryDaily" basada en una fecha guardada en una columna "Fecha de ingresos" en el formato AAAAMMDD como números enteros, almacenados e importados desde una base de datos MySQL con el formato INT YYYYMMDD.

He establecido RangeStart de la siguiente manera:

  • Tipo: Fecha/Hora
  • Requerido: desmarcado
  • Valores sugeridos: Cualquier valor
  • Valor actual: 01/01/2017 00:00:00

Y RangeEnd de la siguiente manera:

  • Tipo: Fecha/Hora
  • Requerido: desmarcado
  • Valores sugeridos: Cualquier valor
  • Valor actual: 12/12/2050 00:00:00

Aquí está mi consulta actual:

Dejar

Fuente: MySQL.Database("10.203.1.116", "FMT_Reporting", [ReturnSingleDatabase-true]),

FMT_Reporting_V2V_GuestHistoryDaily de origen, fuente, [esquema,"FMT_Reporting",elemento"V2V_GuestHistoryDaily"], [Datos],

"Filas filtradas" ? Tabla.SelectRows("FMT_Reporting_V2V_GuestHistoryDaily", cada una [Fecha de ingresos] > Fecha.Año (RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) y [Fecha de ingresos] <- Fecha.Año(RangeEnd)*10000+Fecha.Mes(RangeEnd)*100+Fecha.Día(Intervalo)),

"Columnas eliminadas" - Tabla.RemoveColumns(?"Filas filtradas", "Rev_Room_Net_LC", "Rev_FB_Net_LC", "Rev_BQT_Net_LC", "Rev_SPA_Net_LC", "Rev_Ski_Net_LC", "Rev_Other_Net_LC").

En

"Columnas eliminadas"

Al intentar aplicar la consulta, aparece el siguiente mensaje de error:

Aplicar cambios de consulta

FMT_Reporting V2V_GuestHistoryDaily

No se pudieron guardar las modificaciones en el servidor. Error devuelto: 'Error OLE DB u ODBC: [Expression.Error] No podemos convertir un valor de tipo Function al tipo Logical.. '.

¿Alguna idea de lo que hay que cambiar?

¡Gracias por tu ayuda!

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hola @Marc-Alexis ,

En el paso de "Filas filtradas", hay un "cada uno" adicional. Por favor, quítelo para intentarlo.

= Table.SelectRows(#"FMT_Reporting_V2V_GuestHistoryDaily", each [Revenue date] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [Revenue date] <= Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd))

let

    Source = MySQL.Database("10.203.1.116", "FMT_Reporting", [ReturnSingleDatabase=true]),

    FMT_Reporting_V2V_GuestHistoryDaily = Source{[Schema="FMT_Reporting",Item="V2V_GuestHistoryDaily"]}[Data],

    #"Filtered Rows" = Table.SelectRows(#"FMT_Reporting_V2V_GuestHistoryDaily", each [Revenue date] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [Revenue date] <= Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd)),

    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Rev_Room_Net_LC", "Rev_FB_Net_LC", "Rev_BQT_Net_LC", "Rev_SPA_Net_LC", "Rev_Ski_Net_LC", "Rev_Other_Net_LC"})

in

    #"Removed Columns"

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

¡Hola Xue! Gracias por esto. De hecho, fue el problema. ¡Aprreciado!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.