Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Baron89
Partner - Contributor
Partner - Contributor

Using variables in functions

Hello community,
I want to compare the content of a variable number of fields in a table.

For example, field1: 01/25, field2: 01/24.
Depending on the results, the values should be loaded as flags.
I do this within a loop pass over the stored field names.
However, if I pass a variable to a checking function such as LookUp or even Peek, it returns zero.
For example, I passed the variable '$(field1) to the lookup function for the "field_name" parameter.
But that doesn't work.
The same happens with the Peek function.

If I statically pass the field name as the body of the function, it works.
So, is it possible to call a function within a loop with a variable or is there a better way?

Best regards

Labels (1)
1 Reply
Mark_Little
Luminary
Luminary

Hi,

Haven't got an example, but sure you can it. It might be the way are call the variable. $(field1) means go evaluate what is in the variable and return the contents, where field1 would return the contents.