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: 
erp_curaden
Contributor II
Contributor II

Loop through resident Table

Hi everyone,

I ran into an issue where I need to loop through a dataset and update some values. But I always get an error (undefined for) if I try to use the function "NoOfRows()" in a for-loop:

TableA:
Load
*
From $(PreloadPath)Customer.qvd](qvd);


ResultTable:
Load * Inline [
'A', 'B', 'C'
];

TableB:
For $i=1 to NoOfRows(TableA)
Concatenate(ResultTable)
Load * Inline [
'A', 'B', 'C'
'X', 'X', 'X'
];
Next;

 

If someone has an idea what I'm doing wrong, please reply 🙂

 

Labels (2)
2 Solutions

Accepted Solutions
tresB
Champion III
Champion III

Missing quotes around table name.  Try like:        NoOfRows('TableA')

View solution in original post

Vegar
MVP
MVP

You should not use NoOfRows(TableA) in this case but NoOfRows('TableA') .

 

 

TableA:
Load
  *
From 
   $(PreloadPath)Customer.qvd](qvd);

ResultTable:
Load * 
Inline [
  'A', 'B', 'C'
  ];

TableB:
For $i=1 to NoOfRows('TableA')
  Concatenate(ResultTable)
  Load * 
  Inline [
    'A', 'B', 'C'
    'X', 'X', 'X'
  ];
Next;

 

Read more on the function: NoOfRows - script and chart function

View solution in original post

3 Replies
tresB
Champion III
Champion III

Missing quotes around table name.  Try like:        NoOfRows('TableA')

Vegar
MVP
MVP

You should not use NoOfRows(TableA) in this case but NoOfRows('TableA') .

 

 

TableA:
Load
  *
From 
   $(PreloadPath)Customer.qvd](qvd);

ResultTable:
Load * 
Inline [
  'A', 'B', 'C'
  ];

TableB:
For $i=1 to NoOfRows('TableA')
  Concatenate(ResultTable)
  Load * 
  Inline [
    'A', 'B', 'C'
    'X', 'X', 'X'
  ];
Next;

 

Read more on the function: NoOfRows - script and chart function

erp_curaden
Contributor II
Contributor II
Author

Great, thank you 🙂