Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GetCurrentField() as variable

Hello,

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

The expression is:

IF(GETPOSSIBLECOUNT($(=GETCURRENTFIELD(GROUPFIELD)))>4,1,0)

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?

Labels (1)
4 Replies
sunny_talwar
MVP
MVP

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

Anonymous
Not applicable
Author

I have checked, its working fine...

Not applicable
Author

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:

=$(=$(vCurrentField))

Maybe not the best solution, but it works.

Anonymous
Not applicable
Author

Glad to learn the Field Functions