Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Muchisimas gracias !

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

¿podría explicar mejor?

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Certo,

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

Anonymous
Not applicable
Author

eu espero receber 10-2017 do



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

Anonymous
Not applicable
Author

Tente fazer o seguinte:

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

Anonymous
Not applicable
Author

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