Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a variable in the application which is not evaluating correctly. The code for this variable is
=
'FIELDVALUE('CurrentQtrYear1',FieldIndex('CurrentQtrYear',GetFieldSelections(CurrentQtrYear)))'
The fields 'CurrentQtrYear' and 'CurrentQtrYear1' belong to same table. I am trying to get the value of 'CurrentQtrYear1' for value selected for 'CurrentQtrYear'. When I put the above code in a text box, it evaluates properly but when I try to do this through a variable, it does not work.
Any suggestyions?
Thanks
Amit
I'm not sure what the problem is here, but I would try removing the single quotes around the entire function. Using a QlikView file that I have (different field names), I was able to get this to resolve in a text box:
=FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))
Then, I created a variable (vVal) and set it to:
=FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))
Then in a text box, the following expression gets the same result as the one above:
=vVar
Using single quotes around the entire expression didn't work. This resolved to null:
='FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))'
What happens when you try to use a variable? Is it always null? Are you using multiple selections? This only seems to work on single selections both using a variable and without.
I'm not sure what the problem is here, but I would try removing the single quotes around the entire function. Using a QlikView file that I have (different field names), I was able to get this to resolve in a text box:
=FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))
Then, I created a variable (vVal) and set it to:
=FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))
Then in a text box, the following expression gets the same result as the one above:
=vVar
Using single quotes around the entire expression didn't work. This resolved to null:
='FIELDVALUE('Customer',FieldIndex('FK',GetFieldSelections(FK)))'
What happens when you try to use a variable? Is it always null? Are you using multiple selections? This only seems to work on single selections both using a variable and without.
Thanks, this works.
I was trying to use the variable in set analysis and in text box and used $(vVar) at both the places. Finally it worked with $(vVar) in set analysis and vVar in text box.
Thanks once again.
Amit