Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

evason75
Contributor

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
Valued Contributor

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

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.

4 Replies
pat_agen
Valued Contributor

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

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
New Contributor III

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

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

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

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

LET vStartTime = '=Now()';

That should work...

evason75
Contributor

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

Cheers guys!

Community Browser