Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Replicate Records for other Company Code

I have created a table below where the first column is the Company Code 

risabhroy_03_0-1654764031492.png

I am fetching all data from a QVD like this - 

[A_Stage 1]:

Load
Company_Code,
"T$TANO" as [Task],
"T$DSCA" as [Description],
"T$MCNO" as [Default Machine],
"T$CWOC" as [Default Work Centre],
if("T$MLWC"=1,'Only Default'
,if("T$MLWC"=2,'Specific'
,if("T$MLWC"=3,'All'))) as [Work Centre Selection Method],

if("T$MLMC"=1,'Only Default'
,if("T$MLMC"=2,'Specific'
,if("T$MLMC"=3,'All'))) as [Machine Selection Method]

FROM [$(vSource)\TTIROU003.qvd](qvd);

 

But in the QVD the data is only present for Company Code=215

I want to replicate the whole data for Company Code=220,225,230,235,240.

Can anyone please help me do this? 

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

This might be done within a loop like:

[A_Stage 1]:

Load
pick(iterno(), 215,220,225,230,235,240) Company_Code,
"T$TANO" as [Task],
"T$DSCA" as [Description],
"T$MCNO" as [Default Machine],
"T$CWOC" as [Default Work Centre],
if("T$MLWC"=1,'Only Default'
,if("T$MLWC"=2,'Specific'
,if("T$MLWC"=3,'All'))) as [Work Centre Selection Method],

if("T$MLMC"=1,'Only Default'
,if("T$MLMC"=2,'Specific'
,if("T$MLMC"=3,'All'))) as [Machine Selection Method]

FROM [$(vSource)\TTIROU003.qvd](qvd)
while iterno() <= 6;

- Marcus

View solution in original post

2 Replies
eronevil
Creator
Creator

Hello,

Load data multiple times and name Company code as Company Code.

Like 220 as  Company Code.

Then qlik will automaticly Concatenate tables.

marcus_sommer

This might be done within a loop like:

[A_Stage 1]:

Load
pick(iterno(), 215,220,225,230,235,240) Company_Code,
"T$TANO" as [Task],
"T$DSCA" as [Description],
"T$MCNO" as [Default Machine],
"T$CWOC" as [Default Work Centre],
if("T$MLWC"=1,'Only Default'
,if("T$MLWC"=2,'Specific'
,if("T$MLWC"=3,'All'))) as [Work Centre Selection Method],

if("T$MLMC"=1,'Only Default'
,if("T$MLMC"=2,'Specific'
,if("T$MLMC"=3,'All'))) as [Machine Selection Method]

FROM [$(vSource)\TTIROU003.qvd](qvd)
while iterno() <= 6;

- Marcus