Discussion Board for collaboration related to QlikView App Development.
I'm trying to lookup a field value based on a user selection, I am using Lookup() , but I'm guessing I'm doing something incorrect as I cannot see this working.
This is being used outside the context of a load, hence am I working outside the scope of this function requirement , I am trying to set the variable dynamically , see below...
=if(max(CalendarDate) = lookup('CurrentTo', '[Country Code]', GetFieldSelections([Country Code]) , 'DateNow'),1,0)
Thanks in advance
Hi, It will never work, lookup is a script function only, you'll need to think of a different way.
View solution in original post
Returns the value of fieldname corresponding to the first occurrence of the value matchfieldvalue in the fieldmatchfieldname.
Fieldname, matchfieldname and tablename must be given as strings (e.g. quoted literals).
The search order is load order unless the table is the result of complex operations such as joins, in which case the order is not well defined.
Both fieldname and matchfieldname must be fields in the same table, specified by tablename. If tablename is omitted the current table is assumed.
If no match is found, null is returned.
I occasionally have issues using this function - mainly as I try to avoid it anyway. Couple of things from trial and error:
Can you provide a little more details.
A sample file would also be very helpful.
Also as mentioned by Steve Lookup() can't be used on the Front-end.
Correct, Yes I found another way where I could avoid a lookup completely.
It would be great if you could tell me what is the way to write the expression. I'm facing the same issue
I've had similar situations and ended using the Only() function:
I needed to find the year from my MasterCalandar based on yesterdays date:
So you can see that I'm returning [Acct Year] where my DateID is yesterday.
I'm sure you can adapt this quite easily to suit your needs?