Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

panipat1990
Contributor II

Help

Hi,

  I am New In Qlikview..I want to Know About Loop(For loop)......With Example...Qvw File.......Where We Use For Loop...And Why We Use.....What Is Reason Behind It For Using Loop........How Would I know That I am Use LOOP........With Example

1 Solution

Accepted Solutions

Re: Help

there could be lots of reasons to have a loop, the logic is to reiterate an operation more than one time, in the following example I have to concatenate files into one table doing some check

let path_Alles = '..\Allestimenti\pagella_cliente_Allestimenti_*.xlsx';
for each File in filelist (path_Alles)
IF(left(right(File,11),4)<=$(currYear)) then
PalletInfo:
LOAD
'PalletInfo'
as TableOrig,
if(Len([Reference Client])<>10, Repeat('0',10-Len([Reference Client])) & [Reference Client],[Reference Client]) as shipto_code,
'PALLET'
as type,
Upper(Trim(Subsubcategory)) as competitor,
[WEEK UPDATE] as dataAlles,
[sold to] as customer_code,
[Allestimenti Samsung: Quantità] as palletinfo_qty,
'-'
as pallet_material,
0
as palletinfo_prezzo,
'-'
as palletinfo_serie,
'1'
as datoAssoluto
FROM $(File) (ooxml, embedded labels, table is Display)
Where [WEEK UPDATE] >= 201223 and [WEEK UPDATE] <= 201240 and [Product (short)] = 'PALLET';
ENDIF
next File

3 Replies

Re: Help

Re: Help

there could be lots of reasons to have a loop, the logic is to reiterate an operation more than one time, in the following example I have to concatenate files into one table doing some check

let path_Alles = '..\Allestimenti\pagella_cliente_Allestimenti_*.xlsx';
for each File in filelist (path_Alles)
IF(left(right(File,11),4)<=$(currYear)) then
PalletInfo:
LOAD
'PalletInfo'
as TableOrig,
if(Len([Reference Client])<>10, Repeat('0',10-Len([Reference Client])) & [Reference Client],[Reference Client]) as shipto_code,
'PALLET'
as type,
Upper(Trim(Subsubcategory)) as competitor,
[WEEK UPDATE] as dataAlles,
[sold to] as customer_code,
[Allestimenti Samsung: Quantità] as palletinfo_qty,
'-'
as pallet_material,
0
as palletinfo_prezzo,
'-'
as palletinfo_serie,
'1'
as datoAssoluto
FROM $(File) (ooxml, embedded labels, table is Display)
Where [WEEK UPDATE] >= 201223 and [WEEK UPDATE] <= 201240 and [Product (short)] = 'PALLET';
ENDIF
next File

MVP
MVP

Re: Help

Hi,

Check this link for sample for loop

Load Multiple excel sheets using For loop

Regards,

Jagan.

Community Browser