Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
markgraham123
Contributor II

Auto generate in Scripting

Hi,

I'm working on a req. where i have

WHen i select Country A, i wanna display 1, 2, 3, 4, 5

So, here i wanna use a logic which helps to recognize number ranges between 1 and 5.

1 Solution

Accepted Solutions
Employee
Employee

Re: Auto generate in Scripting

LOAD Area,

     From,

     To,

     From - 1 + IterNo() as Number

FROM Book2.xlsx (ooxml, embedded labels, table is Sheet1)

     While IterNo() <= To - From + 1;

4 Replies
Employee
Employee

Re: Auto generate in Scripting

LOAD Area,

     From,

     To,

     From - 1 + IterNo() as Number

FROM Book2.xlsx (ooxml, embedded labels, table is Sheet1)

     While IterNo() <= To - From + 1;

Employee
Employee

Re: Auto generate in Scripting

I used a loop to autogenerate all the values between from and to for each row of the data

The result is that you can see the full association of data in the UI:

Capture.PNG

Temp:

LOAD Area,

     From,

     To

FROM

(biff, embedded labels, table is Sheet1$);

let vNumRows=NoOfRows('Temp');

for i=0 to $(vNumRows)-1

  let vStart=peek('From',$(i),'Temp');

  let vEnd=peek('To',$(i),'Temp');

  let vNumRowsToGenerate=$(vEnd)-$(vStart)+1;

  load

  Peek('Area',$(i),'Temp') as Area,

  recno()-1+$(vStart) as Value

  AutoGenerate $(vNumRowsToGenerate);

next i;

drop table Temp;

markgraham123
Contributor II

Re: Auto generate in Scripting

Thanq Jonathan.

It worked

markgraham123
Contributor II

Re: Auto generate in Scripting

Thanq Henric.

It worked

Community Browser