Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QFanatic
Creator
Creator

Extract a list of fields from a Table (concatenated)

Hi

PFA

I am trying to extract a list of distinct Tablenames into a delimited string, and I'm not getting it right.

I'm thinking I could probably use the current For..Next ("For Count...")loop to get this, and not to have another resident load.

In fact, I would need to do exactly the same for the field REQ_DATE and REQ_HOUR (long story..... 🙂

Please may you have a look - here is my model.

Thanks

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

@QFanatic if you need list then why don't you just use

LOAD concat(TABLE_NAME,'') as List

FROM Table;

If you want to use it in loop then use fieldvalue & fieldvaluecount functions like below

 

for i=1 to fieldvaluecount('TABLE_NAME') // loop over fieldvalues

let vFieldValue = fieldvalue('TABLE_NAME',$(i)); // get fieldvalue in loop
...
// Do smething

next

 

View solution in original post

4 Replies
Kushal_Chawda

@QFanatic  Do you need list of tables or columns? Can you please elaborate? 

QFanatic
Creator
Creator
Author

Hi Kush I need a list of the values in the 'TABLE_NAME' field, because I have to use it in a for loop later on. Sorry, I wasn't very clear

Kushal_Chawda

@QFanatic if you need list then why don't you just use

LOAD concat(TABLE_NAME,'') as List

FROM Table;

If you want to use it in loop then use fieldvalue & fieldvaluecount functions like below

 

for i=1 to fieldvaluecount('TABLE_NAME') // loop over fieldvalues

let vFieldValue = fieldvalue('TABLE_NAME',$(i)); // get fieldvalue in loop
...
// Do smething

next

 

QFanatic
Creator
Creator
Author

hi Kush,

thank you very much