Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a variable vFlag which I need to reference in an expression for inline table
My inline table
LOAD * INLINE [
field
5
6
-5
];
I need to add the value of vFlag to each row
LET vFlag = 1;
LOAD * INLINE [
field
5+vFlag
6+vFlag
-5+vFlag
];
So I get
6
7
4
I think I've tried just about every DSE variation but not the right one.
=($(vDST)+5) gives =(1+5)
=(1+5) for a textbox gives 6 so why not in the load script? ARGH!!!
Maybe
Let vFlag = 1;
LOAD Field+$(vFlag) as Field inline [
Field
4
6
9
-5
];
Regards,
Antonio
Maybe
Let vFlag = 1;
LOAD Field+$(vFlag) as Field inline [
Field
4
6
9
-5
];
Regards,
Antonio
You could try something like this:
LOAD field, rangesum(field, $(vDST)) as field2 INLINE [
field
5
6
-5
];
- Marcus
Out of curiosity what would the expression be to add the variable to each row - as below?
Granted, its more complicated but need to get stronger grasp of DSE. Thanks
LOAD * INLINE [
field
5+vFlag
6+vFlag
-5+vFlag
];
An INLINE block contains just text, not expressions. Therefore the LOAD is unaware that it should do something with the field values before storing them, although the $-sign expansion will work just fine.
If you want to change this, you can try the evaluate() function to force evaluation of a text string as an expression. In your example, that may look a bit ridiculous, but you'll understand how it works...
LET vFlag = 1;
LOAD Evaluate(field) AS field INLINE [
field
5+$(vFlag)
6+$(vFlag)
-5+$(vFlag)
];
The last value cannot be produced in this way though. QlikView always returns -4. Fair enough?
Best,
Peter