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

Reuse a Calculation in a QVD Load

I have this hypothetical scenario:

LOAD

a,

b,

c,

d * e / f + g - h as UglyCalculation,

x,

y,

z

from My.qvd (qvd);

I need to reuse UglyCalculation and would rather not repeat it everywhere. Is there a way to reference it by alias in further calculations in the same load? I need (for example)

UglyCalculation / x as x1,

UglyCalculation * y as y1,

z

I know that won't work, of course. Can it be managed somehow with a second LOAD statement?

Thanks.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Use preceding load

LOAD *,

UglyCalculation / x as x1,

UglyCalculation * y as y1;

LOAD

a,

b,

c,

d * e / f + g - h as UglyCalculation,

x,

y,

z

from My.qvd (qvd);

View solution in original post

3 Replies
Clever_Anjos
Employee
Employee

Use preceding load

LOAD *,

UglyCalculation / x as x1,

UglyCalculation * y as y1;

LOAD

a,

b,

c,

d * e / f + g - h as UglyCalculation,

x,

y,

z

from My.qvd (qvd);

Not applicable
Author

Thank you. More to my issue at hand, I didn't realize you could "stack" preceding loads, which is exactly what I needed here. It's best not to get carried away, of course, but it's a perfect fit here. Thanks again.