Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

var script load

hi all,

I need help. I have to load an excel file every day, but only current day file. So, i try to use a var in script... but doesn't work.

LOAD * FROM [$(Ruta)] (ooxml, embedded labels, header is 3 lines, table is SN);

Var definition:

'D:\QV\App\data(' & date(today(),'YYYY-MM-DD')& ')*'

Please could you help??

var.png

1 Solution

Accepted Solutions
sunny_talwar

Are you using SET or LET? Try with LET

LET Ruta = 'D:\QV\App\data(' & date(today(),'YYYY-MM-DD')& ')*.xlsx';

LOAD *

FROM [$(Ruta)]

(ooxml, embedded labels, header is 3 lines, table is SN);

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi try this way in script.

Let vDate = Date(Today(),'YYYY-MM-DD')&'.xls';

Load * from 'D:\QV\App\data'&$(vDate)

(ooxml, embedded labels, header is 3 lines, table is SN);

;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sunny_talwar

Are you using SET or LET? Try with LET

LET Ruta = 'D:\QV\App\data(' & date(today(),'YYYY-MM-DD')& ')*.xlsx';

LOAD *

FROM [$(Ruta)]

(ooxml, embedded labels, header is 3 lines, table is SN);

Not applicable
Author

Thanks Sunny

sunny_talwar

Did you want to thank Kaushik? Seems like his solution worked for you

Please mark his response as correct to close the thread down.

Best,

Sunny

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Actually the LET is optional. A clean variable assignment a = b; also expects b to be an expression (or a quoted string or whatever).

The SET on the other hand isn't optional.

But you're probably right. The variable overview shows that Ruta contains a stringized expression, not an evaluated expression. So aside from replacing a SET by a LET, IIRC it could also be fixed by doing something like:

LOAD * FROM [$(=Ruta)] (options);

no?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Thanks stalwar1‌.

What is important is Francisco got the solution.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!