Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Error en Carga

Quiero poner la fecha que trae el nombre del archivo en una variable, pero me da el siguiente error

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

Date(Right($(file),10)) as Fecha_Carga

from $(file)(txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

========================= ERROR =========================

Error in expression:

')' expected

load *,

Date(Right(C:\Users\steam\Desktop\ENEL\GICO\Analisis Emidoc AC 10-2017.XLSX,10)) as Fecha_Carga

from C:\Users\steam\Desktop\ENEL\GICO\Analisis Emidoc AC 10-2017.XLSX(txt, codepage is 1252, no labels, delimiter is ';', msq)

1 Solution

Accepted Solutions
Highlighted
Creator
Creator

Re: Error en Carga

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

Date(Right('$(file)',10)) as Fecha_Carga

from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

View solution in original post

12 Replies
Highlighted
Creator
Creator

Re: Error en Carga

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

Date(Right('$(file)',10)) as Fecha_Carga

from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

View solution in original post

Highlighted
Contributor II
Contributor II

Re: Error en Carga

Muchisimas gracias !

Highlighted
Contributor II
Contributor II

Re: Error en Carga

Podria abusar un poco mas de tus conocimientos y hacer que me carge en fecha_carga lo que esta despues de AC osea el 10-2017 como mes y como año?

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

Date(Right('$(file)',10)) as Fecha_Carga

from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

Highlighted
Creator
Creator

Re: Error en Carga

¿podría explicar mejor?

Highlighted
Contributor II
Contributor II

Re: Error en Carga

eu tenho

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

Date(Right('$(file)',10)) as Fecha_Carga

from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

mais Fecha_Carga esta vazio entao como eu posso fazer pra que ele nao este vazio, eu acho que eu estou fazendo Date(Right('$(file)',10)) ruim

Highlighted
Creator
Creator

Re: Error en Carga

Certo,

O que vc espera receber em "RIGHT('$(file)', 10)" ???

Highlighted
Contributor II
Contributor II

Re: Error en Carga

eu espero receber 10-2017 do



for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

Highlighted
Creator
Creator

Re: Error en Carga

Tente fazer o seguinte:

DATE(DATE#(YourDataFieldName, 'MM-YYYY'),'MM-YYYY')

Highlighted
Contributor II
Contributor II

Re: Error en Carga

SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";

for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')

load *,

DATE(DATE#('$(file)', 'MM-YYYY'),'MM-YYYY') as Fecha_Carga

from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;

next file

ainda tenho Fecha_Carga vazio