Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Editing Variables on the loading script

Hello,

I was wondering if there is a way to edit the value of the variable on the loading script on qlikview.

for example,

Variable:

temp=1000

Load

     F1,

     $(temp) as F2,

    (Here i would like to do temp = temp + 3 or temp = temp+8 depending on some other fields)

     $(temp) as F3, (in here i would use the new temp value to a new field)

From

...

The thing is i would like the variable to keep his new value for every new row of the table.

Is it possible?

The problem above was to avoid explaining a more real and time consuming issue, but if i found out how to that variable value change on the loading script i would be set.

Thanks alot guys,

KR

Labels (1)
1 Reply
swuehl
Champion III
Champion III

I believe you can't change the variable in the loading script (well, maybe using a Macro...).

But maybe you can do similar using Peek(), something like

Let vVar = 1000;

LOAD Field,

  if(recno()=1, $(vVar), peek(Var2)) as Var,

  if(recno()=1, Rangesum($(vVar),Field), Rangesum(peek(Var2),Field)) as Var2;

LOAD * INLINE [

Field

1

3

5

7

-1

];