Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
nihhalmca
Specialist II
Specialist II

Variable using in Fieldindex()

Hi all,

I have to use variable in Fieldindex function.

For example: =fieldindex('Fieldname, $(vCurrency)&amount).

Here vCurrency has $, £, €. and there are 3 buttons like USD, GBP, EUR.

Here Fieldname has $amount, £amount and  €amount.

If i click USD buttion $ should display at vCurrency dynamically and GBP, EUR respectively.

Regards,

Nihhal.

1 Solution

Accepted Solutions
nihhalmca
Specialist II
Specialist II
Author

Hi Sunny - Its working with small changes.

Fieldindex('Fieldname, vCurrency&'amount').

Regards,

Nihhal.

View solution in original post

9 Replies
sunny_talwar

Are you missing a single quote here or is that just a typo?

=FieldIndex('Fieldname', $(vCurrency)&amount)

marcus_sommer

Have a look here: Missing Manual - FieldIndex()

- Marcus

nihhalmca
Specialist II
Specialist II
Author

Not working sunny. Thanks for swift response.

nihhalmca
Specialist II
Specialist II
Author

Thanks for response Marcus however, this is not relevant to my requirement.

alexandros17
Partner - Champion III
Partner - Champion III

Fieldindex return the position of the field value into the fildname, but values in your tables are stored with the currency type?

marcus_sommer

I'm not so sure about it then fieldindex will return only a number - nothing else. Which result do you expect?

Maybe you need something like this:

fieldvalue('Field', fieldindex('Fieldname', $(=$(vCurrency)&amount)))

- Marcus

swuehl
MVP
MVP

Not sure what you want to achieve.

The syntax is

Syntax:

FieldIndex(fieldname , value )

FieldIndex - script function ‒ QlikView

I assume your values are numbers, right? And you want to get the index in the symbol table for your number looking e.g. in the symbol table of $Amount, i.e. both the field name and the value need to be looked up dynamically before evaluating FieldIndex() function?

Like this when using button '$' / USD:

FieldIndex('$Amount', $Amount)

after replacing the variable?

nihhalmca
Specialist II
Specialist II
Author

Hi Sunny - Its working with small changes.

Fieldindex('Fieldname, vCurrency&'amount').

Regards,

Nihhal.

susovan
Partner - Specialist
Partner - Specialist

Hi Nihhal,

Try this,

fieldindex('Fieldname', $(vCurrency)&'amount')

Warm Regards,
Susovan