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
Solved! Go to Solution.
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.
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?