Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find Column(Field) index in a Table by Macro.

Hello Community,

I am new to QlikView development and looking for help.

I am loading a table from LOAD script from DB. I have a Mecro to perform some business logic and generate XLS. In this mecro, I need to find out the column index of a table. The input is the Column name.

Ex. signature of the method function getColumnIdxByColumnName(colName)

set staticTbl = ActiveDocument.GetSheetObject("STATIC_DATA")

colCount = staticTbl.GetColumnCount

rowCount = staticTbl.GetRowCount
set staticCellMatrix = staticTbl.GetCells2(0,0,colCount, rowCount)     

For row = 1 To rowCount - 1
       if staticCellMatrix(row)(inputTypeColIdx).Text = inputValue then
           lookupCid = staticCellMatrix(row)(outputTypeColIdx).Text
      end if


//NOTE:In the above code, inputTypeColIdx and outputTypeColIdx needs to be determinded based on the Column Name.

Please let me know if I am not able to clarify my problem.

I appreciate your time spend on reading this post. Any help is highly appreciated.



0 Replies