Missing Manual - FieldIndex()

              1f4fe19.jpg

        Have you ever wondered how the examples from the Qlikview help may look like?

    Please see below and enjoy responsibly...

     

    FieldIndex()


     

      This function belongs to two groups Chart Inter Record Functions

      and Inter-Record functions.

     

    22-Apr-15 2-14-32 PM.jpg


    Returns the position of the field value value in the field fieldname (by load order). If value cannot be found among the field values of the field fieldname, 0 is returned. Fieldname must be given as a string value, e.g. the field name must be enclosed by single quotes.




     



    Data Model
    (Copy and paste below code into the edit script window and reload)


    LOAD * inline [

    Helptext,Name
    Block,Bob
    Color,John Doe
    Topics,Jenny
    Font,Curt
    Data,Martin
    Group,Mirek
    Total,Stan

    ]


    Now create a straight table and  remember to sort dimension and expression by load order


    Returns position from value specified by second criteria (value)

    • Returns positions of value being searched.
    • field_name must be given as a string value (enclosed with single quotes ('))
    • If value does not exist within column, 0 is returned

     

    Syntax:

    2015-04-23 04_41_10-Text Object Properties [2].png

     

    field_name - the name of your field/column

    value - the value for which you want to know the position

     

    Example

    fieldIndex( 'Name', 'John Doe' )

    2015-04-23 04_33_21-Microsoft Excel - Book1.png

    Bonus


    They said there is no lookup in Qlik front end?

    Think again ...

     

    =FieldValue('Helptext',FieldIndex('Name', 'John Doe'))

     

    by wrapping FieldIndex with FieldValue we can return the unknown value of the 'HelpText' column that corresponds with the given value 'John Doe' of the Name column.

    2015-04-23 04_54_58-Microsoft Excel - Book1.png

    Feeling Qlikngry?

    How To /Missing Manual(20+ articles)