Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
what is subroutines in qlikview? where we use this ?
Here is a script of Sub routine
Sub DecBin (Number) // Function to convert Dec to Binary
LET Output = Floor(Number/POW(2,26),1);
FOR i = 25 to 0 step -1
LET Remainder = Mod(Number,POW(2,$(i)+1));
LET Output = Output & Floor(Remainder/POW(2,$(i)),1);
NEXT i;
End Sub;
FOR x = 1 to NoOfRows('USERS')
tmp:
LOAD userAccountControl as NumberSubmit resident USERS where RecRef = $(x);
Let tmpNumberSubmit = FieldValue('NumberSubmit',1);
CALL DecBin($(tmpNumberSubmit));
BinValues: // store Binary value into a temporary separate table for now
LOAD
RecRef AS RecBack,
$(Output) as BinaryValue
Resident USERS Where RecRef = $(x);
DROP TABLE tmp;
NEXT x;
please explain me this script yar
subroutine is reusable code in qlikview.After writing subroutine we just need to call it once define no need to write it again and again.
Thanks,
Deepak
Hi,
A 'subroutine' is not a term particular to QlikView. This is a term universally used in I.T. Deepak is quite clear in his explanation.
There is a definition in QlikView Help - search for 'SUB'. In QlikView a subroutine is started by the command 'SUB' and closed by the command 'END SUB'. What the subroutine runs is up to you.