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

Why does this simple script generate an error?!?!?

Hi all

I am trying to generate a table with load times. For the life of me i can't understand why this generates an error. If i change the Let's to Set's it works, but will not give me the proper start time.

Any ideas??

LET vStartTime = Now();

....running script for about 2 minutes....

LET vEndTime = Now();

LoadTime:

LOAD 'Stage1' AS Stage, $(vStartTime) AS StartTime, $(vEndTime) AS EndTime AUTOGENERATE(1);

PS I'm running QlikView 9

Cheers

Robbie

1 Solution

Accepted Solutions
pat_agen
Specialist
Specialist

hi,

just enclose your variables in simple quotes in th eload statement:

LoadTime:

LOAD 'Stage1' AS Stage,

'$(vStartTime)' AS StartTime,

'$(vEndTime)' AS EndTime AUTOGENERATE(1);

that should do it.

View solution in original post

4 Replies
pat_agen
Specialist
Specialist

hi,

just enclose your variables in simple quotes in th eload statement:

LoadTime:

LOAD 'Stage1' AS Stage,

'$(vStartTime)' AS StartTime,

'$(vEndTime)' AS EndTime AUTOGENERATE(1);

that should do it.

patrickanderson
Partner - Contributor III
Partner - Contributor III

How about this?

X.ReloadTime:

REPLACE LOAD

          now() as ReloadTime

AUTOGENERATE (1);

///Script...........................

// At end of Script Put below.

LET StartTime = num(peek('ReloadTime',-1,'X.ReloadTime'));

X.LoadTime:

REPLACE LOAD

          interval(now() - $(StartTime),'h:m:ss') as LoadTime

AUTOGENERATE (1);

Not applicable
Author

if you create a line in your load script and type this.

LET vStartTime = '=Now()';

That should work...

Anonymous
Not applicable
Author

Cheers guys!