Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
can anyone spot an error with this variable,
ive put the formula i a text box to ensure it works and its fine,
Set V1 = =only( {$< [/rec] = {'upstream'}, [/rec/parameter] = {'mosAddress'}>}[/rec/parameter/curval]);
Could it be the 2 equals signs after the V1 ?
Hi Samuel
First of al, delete the second '=' in the line, if you are not using quote symbols. seeing that you want to use set analysis, i would recommend the '' symbols.
it should look like this:
SET V1 = ' =only( {$< [/rec] = {'upstream'}, [/rec/parameter] = {'mosAddress'}>}[/rec/parameter/curval])' ;
if you want to apply the variable in the script, set analysis is not your friend. that will only work in the actual document. You should maybe try
if() and where clauses
regards,
Dick
Since you posted a "set" statement I think you're trying to load a variable in load script using qlikview "set expression", which use is possible only in the document, and it returns correct value, but not in load statement.
To generate a calculated variable in the script, starting from a single field previously loaded, the correct statement is "LET", anyway, you have to proceed in two distinct steps:
1 Load Temporary Table, Example:
TemporaryRPC:
LOAD
Distinct
[/rec/parameter/curval]
Resident YourTableName // INSERT YOUR QLIK TABLE NAME
Where [/rec] = 'upstream' and [/rec/parameter] = 'mosAddress';
2 LET STATEMENT WITH PEEK FUNCTION, Example:
LET V1 = Peek('[/rec/parameter/curval]',0,'YourTableName');
3 DROP TEMPORARY TABLE, Example:
DROP Table TemporaryRPC;
However, you should have to post an example qvw if you can.
Did you try this?