CSV Duplicate columns

Hi,
We have a problem when we generate a CSV by a Bot
The CSV file duplicates some columns

This is the code:
<<START:ORDERBY(ORDERBY(ORDERBY(ORDERBY(ORDERBY(ORDERBY(SELECT(Correo ZN[_RowNumber];TRUE;TRUE);[Fecha_ref];);[Concepto];);[Legajo];);[lpd_descrip];);[Provincia];);[Empresa])>>โ€œEmpresaโ€,โ€œProvinciaโ€,โ€œLugar de Pagoโ€,โ€œPersonaโ€,โ€œLegajoโ€,โ€œConceptoโ€,โ€œCodigoโ€,โ€œFechaโ€,โ€œCantidad a Liquidarโ€
โ€œ<<[Empresa]>>โ€,"<<[Provincia]>>","<<[lpd_descrip]>>","<<[Persona]>>","<<[Legajo]>>","<<[Concepto]>>","<<[Codigo_Con]>>","<<[Fecha_ref]>>","<<[Cantidad a Liquidar]>>"<>

How do we eliminate the duplicates?

0 5 111
5 REPLIES 5

Your headers should be before the START expression, not inside of it.

We tried this option and the code stayed this way:
โ€œEmpresaโ€,โ€œProvinciaโ€,โ€œLugar de Pagoโ€,โ€œPersonaโ€,โ€œLegajoโ€,โ€œConceptoโ€,โ€œCodigoโ€,โ€œFechaโ€,โ€œCantidad a Liquidarโ€<<START:ORDERBY(ORDERBY(ORDERBY(ORDERBY(ORDERBY(ORDERBY(SELECT(Correo ZN[_RowNumber];TRUE;TRUE);[Fecha_ref];);[Concepto];);[Legajo];);[lpd_descrip];);[Provincia];);[Empresa])>>
โ€œ<<[Empresa]>>โ€,"<<[Provincia]>>","<<[lpd_descrip]>>","<<[Persona]>>","<<[Legajo]>>","<<[Concepto]>>","<<[Codigo_Con]>>","<<[Fecha_ref]>>","<<[Cantidad a Liquidar]>>"<>

And the result was that the information was in a single row

You need to add a line break in your template between headers and START.

Soโ€ฆ
Then the formula should be like this:

โ€œEmpresaโ€,โ€œProvinciaโ€,โ€œLugar de Pagoโ€,โ€œPersonaโ€,โ€œLegajoโ€,โ€œConceptoโ€,โ€œCodigoโ€,โ€œFechaโ€,โ€œCantidad a Liquidarโ€
<<START:ORDERBY(ORDERBY(ORDERBY(ORDERBY(ORDERBY(ORDERBY(SELECT(Correo ZN[_RowNumber];TRUE;TRUE);[Fecha_ref];);[Concepto];);[Legajo];);[lpd_descrip];);[Provincia];);[Empresa])>>
โ€œ<<[Empresa]>>โ€,"<<[Provincia]>>","<<[lpd_descrip]>>","<<[Persona]>>","<<[Legajo]>>","<<[Concepto]>>","<<[Codigo_Con]>>","<<[Fecha_ref]>>","<<[Cantidad a Liquidar]>>"<>

And we letโ€™s read the ORDERBY() article so as not to nest the expression

Also, you donโ€™t need to nest ORDERBYs like that, a single ORDERBY() can accept any number of arguments.

Top Labels in this Space