Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

yousef_am
Contributor II

Generate numbers in range

Hello,

I need to generate numbers between a range in the load script, please see attached an excel sheet that contains 2 sheets, I need to use the data in sheet1 to get the data in End Result sheet (convert the range to actual data in one column)

Thanks.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Generate numbers in range

Hi Yousef

try this

Regards

Directory;

Tmp:

LOAD Name,

     From,

     To

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

Table:

NoConcatenate

Load

      Name,

      From + IterNo() - 1 as NewField          // Number

      Resident Tmp

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

    

    

DROP Table Tmp;    

4 Replies
MVP
MVP

Re: Generate numbers in range

Hi Yousef

try this

Regards

Directory;

Tmp:

LOAD Name,

     From,

     To

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

Table:

NoConcatenate

Load

      Name,

      From + IterNo() - 1 as NewField          // Number

      Resident Tmp

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

    

    

DROP Table Tmp;    

Re: Generate numbers in range

HI

PFA

yousef_am
Contributor II

Re: Generate numbers in range

Thanks

Not applicable

Re: Generate numbers in range

Hey guys, 

I am given a task to calculate the frequency of calls across a territory. If the rep called a physician regarding the sale of the product 5 times, then frequency is 5 and HCP count is 1....I generated frequencies from 1 to 124 in my pivot table using a calculated dimension which is working fine. But my concern is :

My manager wants frequencies till 19 in order from 1..2..3..4...5..6.....19...

And from the frequency 21-124 as 20+.

I would be grateful if someone helps me with this.....Eager for the reply....

Community Browser