Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

For loop in Load script

I have data set as under


Capture.PNG

I want the same result five times like

REGION   STATE   SALES  SCENARIO

EAST-1    NY         10              1

EAST-1    NJ          5                 1

EAST-1    MD         3                1

WEST-1    NY         7                1

WEST-1    NY         15               1

Same result for five times instead 1, I need 2,3, 4 & 5

Sample QV attached...

Thanks

Labels (1)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

another one

Sales:

LOAD * INLINE [

    REGION, STATE, SALES

    EAST, NY, 10

    EAST, NJ, 5

    EAST, MD, 3

    WEST, CA, 7

    WEST, AR, 15

];

left join (Sales)

load rowno() as SCENARIO AutoGenerate 5;

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

MyTable:

LOAD REGION, STATE, SALES, IterNo() as SCENARIO

FROM ....

WHILE IterNo() <6;


talk is cheap, supply exceeds demand
Miguel_Angel_Baeyens
Support
Support

Hi Satish,

Use

Table:

LOAD *,

     1 AS SCENARIO

FROM File.qvd (qvd);

FOR i = 2 TO 5

CONCATENATE (Table)

LOAD *,

     $(i) AS SCENARIO

FROM File.qvd (qvd);

LOOP

Miguel

maxgro
MVP
MVP

another one

Sales:

LOAD * INLINE [

    REGION, STATE, SALES

    EAST, NY, 10

    EAST, NJ, 5

    EAST, MD, 3

    WEST, CA, 7

    WEST, AR, 15

];

left join (Sales)

load rowno() as SCENARIO AutoGenerate 5;

Anonymous
Not applicable
Author

Hi Miguel

I appreciate your solution, work nicely

Thanks

Anonymous
Not applicable
Author

Hi Massimo

This is working nice.

I appreciate your effort

Thanks