Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
trying to get subroutine called to use variable value.. the variables is set from a column using for. but getting errors.. any idea?
ListOfFiles:
Load * inline [
Files
ABC
ASD
AQW
AQSW
];
Sub ScanData
let vss = $(vSetofFile) ;
End Sub
Let vNumofFiles = noofrows('ListOfFiles');
For i= 1 to $(vNumofFiles)
Let vSetofFiles = fieldvalue('ListOfFiles',$(i));
Call ScanData
Next;
may be helpful for you?
I didn't get any error running this script snippet.
Hi,
Try like this
Sub ScanData (index, SetOfFile)
If index = 1 THEN
table2:
Load * inline [
SS
1
];
ENDIF
Concatenate(table2)
Load '$(SetOfFile)' as SS
AutoGenerate (1);
End Sub
ListOfFiles:
Load * inline [
Files
ABC
ASD
AQW
AQSW
];
ListOfFiles:
Load * inline [
ListOfFiles
AluminiumPrimia-A
AluminiumPrimia-B
CopperPrimia-A
CopperPrimia-B
];
Let vNumofFiles = noofrows('ListOfFiles');
For i= 1 to $(vNumofFiles)
Let vSetofFiles= fieldvalue('ListOfFiles',$(i));
Call ScanData(i, vSetofFiles)
Next;
Hope this helps you
Regards,
Jagan.
can you explain, what you are trying to achieve ? What would be your output?
thank you guys,
I made some changes to the question..
it doesnt give an error now but it return null values too if you debug it..
HI,
Did you tried the script which I posted? It is working for me.
Regards,
Jagan.
Hi Please follow be below link:
Code Reusability in QlikView and Debugging QlikView Scripts - YouTube
Regards
Rajesh Kumar
Try,
ListOfFiles:
Load * inline [
Files
ABC
ASD
AQW
AQSW
];
Sub ScanData
let vss = vSetofFiles ;
End Sub
Let vNumofFiles = noofrows('ListOfFiles');
For i= 1 to $(vNumofFiles)
Let vSetofFiles = fieldvalue('Files',$(i));
Call ScanData
Next;
BTW, What is your exact requirement.?
Which null are you talking about? The one returned by the following statement?
let vss = $(vSetofFile)
If so, it's obvious, because variable vSetofFile is not defined before you use it here. And in the snippet, you don't use vss either. So you can probably remove that line itself. I am not sure if you meant something else.