Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

marko_rakar
Contributor

Using IF statement in load while using variable

I am trying to use IF statement in my load script and this IF statement should use variable to check if conditions are met:

let noRows = NoOfRows('Transposed')-1;

let vNo = 0;

for i = 0 to $(noRows)

       

        let Kan = peek('Kan',$(i),'Transposed');

        let Gla = peek('Gla',$(i),'Transposed');

        let ID = peek('ID',$(i),'Transposed');

       

        if( $(vNo) = '0', let Li = Peek('Kan',$(i), 'Transposed'));

       

        EnumeratedAndTransposed:

        LOAD

        '$(Kan)' as Kan,

        '$(Gla)' as Gla,

        '$(ID)' as ID,

        '$(Li)' as Li

       

        FROM RESIDENT Transponded;

if (($(no)=12), let n = 0, let n=n+1);

next i;

Problem is in my IF statement, for some reason they do not work. Idea behind this code is to enumerate rows as a member of particular group (first 12 rows are member of same group and group name is contained in first record). After 12th record I reset my counter and begin again.

When I enter the code as above, in my script editor I have red underlined comma and my statement does not work.

Any ideas?