Justlogmein
Tengo una tabla donde casi todos los encabezados son fechas. Esta fuente de datos cambia dinámicamente y las fechas también cambiarán, por lo que si mis consultas (como Cambiar tipo) hacen referencia a los encabezados actuales, obtendré errores cuando cambie la fuente de datos. Sin embargo, las filas de la columna Persona también pueden cambiar, por lo que tampoco puedo usarlas como encabezados. Entonces, estoy buscando una forma sólida de organizar la tabla para no obtener errores (¿estoy pensando en Persona, Fecha y Valor como nombres de columna?) Me gustaría saber si hay mejores formas de hacer esto , y cuál sería el código para hacerlo.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VZQ9blwxDITvsrWL1R8llUnpIMgBDBeLZIsAuw4QV769lx8zfEhDvCeJ5AxnpJeX05f7x+nptM1DfYS1PZwfofhXHf519v82H2GUR7CmM5U81lSle5XpofqJkaWs+6/XG1X5zdcKPZZnNJ0jA0CTXa9s3qc7ijYSqf8ui43XpwefX5e7J1T1qV54g6IJVBCCRk3gw5RHN05371G878oyMQIHaX7YtrBEzyMDpFtVOny9yvLK00OZqtKKpsGu+eHZYfR8uV/f1RIYfWTfoubdd+tWbvQ1NbKhr5Z6zK3miIwey6tMnYgx7a5Sa2TuWVQBDvNGaNl3a5LQ2jPWnNHX37fbh4SPjSmr0GMWTW3mrDakp4wI5o1pvG8vKtCXCjAcJMNXTA03AQgPIbInlC7FsO4WFQptLZMdMJmqQefbx+0q5MDqLVGalA/5h8zGxI57NH0Np4YqRV6Zh11D+qW5zdQBVLulDZlWldb/DO/AsfAW1GaaIDb0jxGEnv9c3t6u0sZkp3BrT5ZbLEOurIkB+UWVcHrRuSGDMCVItbzTgF1ppLjxJn2w9+CLO1ilRni8CnHc+xazdkLfrzfNBB0ZUUuDcpW4/iNlAQ5Y8zmaSwxHWi4gNZmq56MxBf+YP/3NUsqqAKWWRoU/5mUwAaAGCmfz4/3n5e9/hivpitqFB527As8mUI5raunreB6Oh3toAKQx3cOcvAe8+XgJ3On6eFM5xtoSvXjuLU3FE3F6ff0E", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Person = _t, #"19/03/2021" = _t, #"20/03/2021" = _t, #"21/03/2021" = _t, #"22/03/2021" = _t, #"23/03/2021" = _t, #"24/03/2021" = _t, #"25/03/2021" = _t, #"26/03/2021" = _t, #"27/03/2021" = _t, #"28/03/2021" = _t, #"29/03/2021" = _t, #"30/03/2021" = _t, #"31/03/2021" = _t, #"1/04/2021" = _t, #"2/04/2021" = _t, #"3/04/2021" = _t, #"4/04/2021" = _t, #"5/04/2021" = _t, #"6/04/2021" = _t, #"7/04/2021" = _t, #"8/04/2021" = _t, #"9/04/2021" = _t, #"10/04/2021" = _t, #"11/04/2021" = _t, #"12/04/2021" = _t, #"13/04/2021" = _t, #"14/04/2021" = _t, #"15/04/2021" = _t, #"16/04/2021" = _t, #"17/04/2021" = _t, #"18/04/2021" = _t, #"19/04/2021" = _t, #"20/04/2021" = _t, #"21/04/2021" = _t, #"22/04/2021" = _t, #"23/04/2021" = _t, #"24/04/2021" = _t, #"25/04/2021" = _t, #"26/04/2021" = _t, #"27/04/2021" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Person", type text}, {"19/03/2021", Int64.Type}, {"20/03/2021", Int64.Type}, {"21/03/2021", Int64.Type}, {"22/03/2021", Int64.Type}, {"23/03/2021", Int64.Type}, {"24/03/2021", Int64.Type}, {"25/03/2021", Int64.Type}, {"26/03/2021", Int64.Type}, {"27/03/2021", Int64.Type}, {"28/03/2021", Int64.Type}, {"29/03/2021", Int64.Type}, {"30/03/2021", Int64.Type}, {"31/03/2021", Int64.Type}, {"1/04/2021", Int64.Type}, {"2/04/2021", Int64.Type}, {"3/04/2021", Int64.Type}, {"4/04/2021", Int64.Type}, {"5/04/2021", Int64.Type}, {"6/04/2021", Int64.Type}, {"7/04/2021", Int64.Type}, {"8/04/2021", Int64.Type}, {"9/04/2021", Int64.Type}, {"10/04/2021", Int64.Type}, {"11/04/2021", Int64.Type}, {"12/04/2021", Int64.Type}, {"13/04/2021", Int64.Type}, {"14/04/2021", Int64.Type}, {"15/04/2021", Int64.Type}, {"16/04/2021", Int64.Type}, {"17/04/2021", Int64.Type}, {"18/04/2021", Int64.Type}, {"19/04/2021", Int64.Type}, {"20/04/2021", Int64.Type}, {"21/04/2021", Int64.Type}, {"22/04/2021", Int64.Type}, {"23/04/2021", Int64.Type}, {"24/04/2021", Int64.Type}, {"25/04/2021", Int64.Type}, {"26/04/2021", Int64.Type}, {"27/04/2021", Int64.Type}})
in
#"Changed Type"
Fowmy
@justlogmein
Compruebe esta versión. De esta forma será muy útil para tu análisis.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VZQ9blwxDITvsrWL1R8llUnpIMgBDBeLZIsAuw4QV769lx8zfEhDvCeJ5AxnpJeX05f7x+nptM1DfYS1PZwfofhXHf519v82H2GUR7CmM5U81lSle5XpofqJkaWs+6/XG1X5zdcKPZZnNJ0jA0CTXa9s3qc7ijYSqf8ui43XpwefX5e7J1T1qV54g6IJVBCCRk3gw5RHN05371G878oyMQIHaX7YtrBEzyMDpFtVOny9yvLK00OZqtKKpsGu+eHZYfR8uV/f1RIYfWTfoubdd+tWbvQ1NbKhr5Z6zK3miIwey6tMnYgx7a5Sa2TuWVQBDvNGaNl3a5LQ2jPWnNHX37fbh4SPjSmr0GMWTW3mrDakp4wI5o1pvG8vKtCXCjAcJMNXTA03AQgPIbInlC7FsO4WFQptLZMdMJmqQefbx+0q5MDqLVGalA/5h8zGxI57NH0Np4YqRV6Zh11D+qW5zdQBVLulDZlWldb/DO/AsfAW1GaaIDb0jxGEnv9c3t6u0sZkp3BrT5ZbLEOurIkB+UWVcHrRuSGDMCVItbzTgF1ppLjxJn2w9+CLO1ilRni8CnHc+xazdkLfrzfNBB0ZUUuDcpW4/iNlAQ5Y8zmaSwxHWi4gNZmq56MxBf+YP/3NUsqqAKWWRoU/5mUwAaAGCmfz4/3n5e9/hivpitqFB527As8mUI5raunreB6Oh3toAKQx3cOcvAe8+XgJ3On6eFM5xtoSvXjuLU3FE3F6ff0E", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Person = _t, #"19/03/2021" = _t, #"20/03/2021" = _t, #"21/03/2021" = _t, #"22/03/2021" = _t, #"23/03/2021" = _t, #"24/03/2021" = _t, #"25/03/2021" = _t, #"26/03/2021" = _t, #"27/03/2021" = _t, #"28/03/2021" = _t, #"29/03/2021" = _t, #"30/03/2021" = _t, #"31/03/2021" = _t, #"1/04/2021" = _t, #"2/04/2021" = _t, #"3/04/2021" = _t, #"4/04/2021" = _t, #"5/04/2021" = _t, #"6/04/2021" = _t, #"7/04/2021" = _t, #"8/04/2021" = _t, #"9/04/2021" = _t, #"10/04/2021" = _t, #"11/04/2021" = _t, #"12/04/2021" = _t, #"13/04/2021" = _t, #"14/04/2021" = _t, #"15/04/2021" = _t, #"16/04/2021" = _t, #"17/04/2021" = _t, #"18/04/2021" = _t, #"19/04/2021" = _t, #"20/04/2021" = _t, #"21/04/2021" = _t, #"22/04/2021" = _t, #"23/04/2021" = _t, #"24/04/2021" = _t, #"25/04/2021" = _t, #"26/04/2021" = _t, #"27/04/2021" = _t]),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Person"}, "Attribute", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Value", Int64.Type}, {"Attribute", type date}},"en-gb"),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Attribute", "Date"}})
in
#"Renamed Columns"
Fowmy
@justlogmein
Compruebe esta versión. De esta forma será muy útil para tu análisis.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VZQ9blwxDITvsrWL1R8llUnpIMgBDBeLZIsAuw4QV769lx8zfEhDvCeJ5AxnpJeX05f7x+nptM1DfYS1PZwfofhXHf519v82H2GUR7CmM5U81lSle5XpofqJkaWs+6/XG1X5zdcKPZZnNJ0jA0CTXa9s3qc7ijYSqf8ui43XpwefX5e7J1T1qV54g6IJVBCCRk3gw5RHN05371G878oyMQIHaX7YtrBEzyMDpFtVOny9yvLK00OZqtKKpsGu+eHZYfR8uV/f1RIYfWTfoubdd+tWbvQ1NbKhr5Z6zK3miIwey6tMnYgx7a5Sa2TuWVQBDvNGaNl3a5LQ2jPWnNHX37fbh4SPjSmr0GMWTW3mrDakp4wI5o1pvG8vKtCXCjAcJMNXTA03AQgPIbInlC7FsO4WFQptLZMdMJmqQefbx+0q5MDqLVGalA/5h8zGxI57NH0Np4YqRV6Zh11D+qW5zdQBVLulDZlWldb/DO/AsfAW1GaaIDb0jxGEnv9c3t6u0sZkp3BrT5ZbLEOurIkB+UWVcHrRuSGDMCVItbzTgF1ppLjxJn2w9+CLO1ilRni8CnHc+xazdkLfrzfNBB0ZUUuDcpW4/iNlAQ5Y8zmaSwxHWi4gNZmq56MxBf+YP/3NUsqqAKWWRoU/5mUwAaAGCmfz4/3n5e9/hivpitqFB527As8mUI5raunreB6Oh3toAKQx3cOcvAe8+XgJ3On6eFM5xtoSvXjuLU3FE3F6ff0E", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Person = _t, #"19/03/2021" = _t, #"20/03/2021" = _t, #"21/03/2021" = _t, #"22/03/2021" = _t, #"23/03/2021" = _t, #"24/03/2021" = _t, #"25/03/2021" = _t, #"26/03/2021" = _t, #"27/03/2021" = _t, #"28/03/2021" = _t, #"29/03/2021" = _t, #"30/03/2021" = _t, #"31/03/2021" = _t, #"1/04/2021" = _t, #"2/04/2021" = _t, #"3/04/2021" = _t, #"4/04/2021" = _t, #"5/04/2021" = _t, #"6/04/2021" = _t, #"7/04/2021" = _t, #"8/04/2021" = _t, #"9/04/2021" = _t, #"10/04/2021" = _t, #"11/04/2021" = _t, #"12/04/2021" = _t, #"13/04/2021" = _t, #"14/04/2021" = _t, #"15/04/2021" = _t, #"16/04/2021" = _t, #"17/04/2021" = _t, #"18/04/2021" = _t, #"19/04/2021" = _t, #"20/04/2021" = _t, #"21/04/2021" = _t, #"22/04/2021" = _t, #"23/04/2021" = _t, #"24/04/2021" = _t, #"25/04/2021" = _t, #"26/04/2021" = _t, #"27/04/2021" = _t]),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Person"}, "Attribute", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Value", Int64.Type}, {"Attribute", type date}},"en-gb"),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Attribute", "Date"}})
in
#"Renamed Columns"