"Custom Column" with a `/` (slashes) in name will fail the query in version 0.35.1

So I have a question that had some custom culumns. However, I am getting this error:

Can anyone please advise on what I should do to make this question compatible with the new version?

Can you alias that column name? Just guessing but having a / in the middle of a column isn’t a great idea.

1 Like

@rviteri
Please post “Diagnostic Info” from Admin > Troubleshooting.
Which version were you using before, when it used to work?
Which database are you querying?
Like Andrew says, having special characters in column names can create some problems.

Here is the diagnostic info:

{
  "browser-info": {
    "language": "es-ES",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "1.8.0_242-8u242-b08-0ubuntu3~16.04-b08",
    "java.vendor": "Private Build",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "1.8.0_242",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "25.242-b08",
    "os.name": "Linux",
    "os.version": "4.4.0-176-generic",
    "user.language": "en",
    "user.timezone": "America/Guayaquil"
  },
  "metabase-info": {
    "databases": [
      "mysql",
      "postgres",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "prod",
    "version": {
      "tag": "v0.35.1",
      "date": "2020-04-02",
      "branch": "release-0.35.x",
      "hash": "e67f169"
    },
    "settings": {
      "report-timezone": "America/Bogota"
    }
  }
}

It was working with Metabase v0.34.1 v0.34.2 and I am querying a MySQL database.

@rviteri You should migrate away from H2:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
Where does PAX/día come from? Is it a Custom Column or …?
Can you provide a way to reproduce this?

Thanks, I will try to migrate tonight.

Yes, it was a custom column created from the GUI. This table was also created joining other tables using the GUI.

@rviteri It would be great if you can provide steps to reproduce the problem. If possible use the Sample Dataset, but I’m not sure if error only occurs with MySQL, so in that case steps for that.

hello, I rolled back to version 0.34.2 and it works.

This report starts from a native query and then I apply a calculated column as show below.

This is the code of the orginal question:

SELECT

MIN(CAST(T.fecha AS DATE)) AS Fecha_primer_paciente, 
MAX(CAST(T.fecha AS DATE)) AS Fecha_ultimo_paciente,
MAX(CAST(D.fecha AS DATE)) AS Fecha_ultima_visita,
DATEDIFF(MAX(T.fecha), MIN(T.fecha)) as Dias_de_Antiguedad,

COUNT (T.id) AS No_Atenciones,
SUM(ABS(PD.saldo - PD.abono -  PD.desc) + PD.abono) as Ventas,
/*CONCAT( P.apellidos,  ' ',P.nombre ) AS Paciente, */
CONCAT( A.apellidos,  ' ', A.nombre ) AS Doctor,
B.nombre_padre as Direccion,
B.nombre_madre as Direccion2,

/*L.nombre AS Laboratorio,*/
/*IF(PD.liberado=1, "1", "") as Lib,
IF(PD.pagado=1, "1", "") as P,*/


/*F.abreviatura as TPago,
PD.empresa as Emp,*/


(
SELECT CONCAT( M.apellidos,  ' ', M.nombre )
FROM adm_user M
WHERE M.id = B.id_vendedor
) AS  Vendedor

/*(
SELECT if (ZZ.id >=0,"SI","")
            from visitas_doctor ZZ
            where ZZ.id_doctor=A.id
            limit 1
) as Visitado,*/


/*C.porcentaje AS Porcentaje,
ABS(ROUND((PD.saldo -  PD.desc)*(C.porcentaje/100),2))  AS Comision*/


FROM test_completo T
INNER JOIN pagos_detalles PD ON PD.id_test_completo = T.id
INNER JOIN adm_empresa L ON T.id_empresa = L.id
INNER JOIN adm_user A ON T.id_doctor = A.id
INNER JOIN adm_user_doctor B ON A.id = B.id
INNER JOIN visitas_doctor D ON T.id_doctor = D.id_doctor
INNER JOIN comisiones C ON C.id = B.id_comisiones
INNER JOIN pacientes P ON P.id = T.id_paciente
INNER JOIN adm_empresa E ON E.id= T.id_empresa
INNER JOIN forma_pago F ON F.idformapago = PD.tipopago
INNER JOIN registro_pagos R ON R.id_pagos_detalles = PD.id
GROUP BY Doctor

@rviteri https://github.com/metabase/metabase/issues/12305 - upvote by clicking :+1: on the first post

1 Like

Done. Thanks.

Thank you. I just finished the migration to Postgres.