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: 
Not applicable

Count fields in script

In the load script how to count the number of Fields on a table with name (so headers, not content) started by "abc" for example?

5 Replies
datanibbler
Champion
Champion

Use a WHERE clause - if the searched-for letters are always the first ones in the string - nothing easier. Use a LEFT() function.

HTH

Best regards,

DataNibbler

Not applicable
Author

But I want to count the number of columns named something, not the contents as I explained before.

Thanks,

Miguel

datanibbler
Champion
Champion

Hi Miguel,

that is also possible. I'm not quite sure how, but there are the so-called "table functions" (look for them in the help file) that can be used in the script to get information about the currently loaded table. You can go from there (NoOfFields is probably the right one, combined with a WHERE_clause)

rustyfishbones
Master II
Master II

Add a text object with

2013-11-19_1511.png

sivarajs
Specialist II
Specialist II

You can try this

LET vnew=NoOfFields('Tablename'); //you should use after the table is loaded.