Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
arethaking
Creator II
Creator II

Please explain this cod.

//Dynamic IntervalMatch mapping

//Alexander Karlsson - Ze Demoz Teamz - 2013-09-24

//Point to your excel file

temp:

LOAD DISTINCT FieldName

FROM

RiskData.xlsx

(ooxml, embedded labels, table is [Bucket Templates]);

LET noRows = NoOfRows('temp');

for j=0 to $(noRows)-1

let vFieldValue = peek('FieldName',$(j),'temp');

let vFieldEncoded = '[$(vFieldValue)]';

  $(vFieldEncoded):

  LOAD FieldName,

      StartRange,

      EndRange,

      Label as [$(vFieldValue) Bucket],

      SortOrder as [$(vFieldValue) BucketSort]

  FROM

  RiskData.xlsx

  (ooxml, embedded labels, table is [Bucket Templates]) where FieldName = '$(vFieldValue)';

  IntervalMatch($(vFieldEncoded))

  Left Join ($(vFieldEncoded)) Load StartRange,EndRange Resident $(vFieldEncoded) where FieldName = '$(vFieldValue)';

Next

DROP TABLE temp;

Drop Fields StartRange,EndRange,FieldName;

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

It will loop thru Sheets(tabs) in

RiskData.xlsx

based on  FieldName.

View solution in original post

1 Reply
robert_mika
Master III
Master III

It will loop thru Sheets(tabs) in

RiskData.xlsx

based on  FieldName.