Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

GetCurrentField() as variable


I'm trying to put an expression into a variable, but I encounter problems with one specific expression.

The expression is:


This expression works this way when I use it literally in the expression box. But when I try to put in a variable in the script, I don't get a result. The problem is in the GETCURRENTFIELD() - when I type instead one of the possible fields, the expression is working.

Is there any solution for this? Or do I just have to use the expression instead of a variable for this calculation?

4 Replies

Re: GetCurrentField() as variable

May be trigger the value of GetCurrentField into a varialble and use the variable instead of the function itself

Valued Contributor II

Re: GetCurrentField() as variable

I have checked, its working fine...

Not applicable

Re: GetCurrentField() as variable

Tried to put the GetCurrentField into a variable, but couldn't use it in a next variable.

But I have found the solution:

SET vCurrentField='If((GetPossibleCount('&GetCurrentField(GROUP)&'))>4,1,0)';

In the expression box, I need to use this variable with the Dollar Sign Expansion:


Maybe not the best solution, but it works.

Valued Contributor

Re: GetCurrentField() as variable

Glad to learn the Field Functions

Community Browser