Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

issue involving calulated dimensions and the GetCurrentField(groupname) Function

here's my problem:

I have two calculated dimensions "eMyCalcDimension1" and "eMyCalcDimension2" in a group "mygroup"

getcurrentfield(mygroup) returns "=$(eMyCalcDimension)" when shown in a text box. (without the quotes)

I am trying to use the function "getcurrentfield(mygroup)" to conditionally change the help text on a chart based on the active group dimension in a cyclic group.

I have put this function in my help text expression:

=if(GetCurrentField(mygroup) = '=$(eMyCalcDimension1)', 'This is help text 1', 'This is help text 2')

this returns null

i have tried using the label instead with no success, I have tried almost every variation of the variable name without the = or $,(,), etc... none work the way expected. I'm guessing there is some way to include special characters like '=$()' into a string literal without it trying to evaluate the expression??

please help me! or if this is something qlikview simply cant do let me know so I stop going crazy ='(

Thanks!
Zach Boyer

1 Solution

Accepted Solutions
Not applicable
Author

WAIT!! Ok so I've figured it out for variables, since my calculated expression is a $ expansion and the only reason I cant properly compare it to the return result of getcurrentfield(mygroup) is because the name has a $() in it and wants to evaluate the expression I simply purgechar(getcurrentfield(mygroup), '$')  and compare it to '=(eCalcDimension)' adn it WORKS!!

Thanks for the reply 😃 it sparked my own solution.

View solution in original post

3 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

See the attachment.

But I am not sure if I do a right thing with calculated dimension.

Regards,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
Not applicable
Author


You've got the gist of it but consider this issue in my attachment where the calculated dimension contains quotes, in my actual issue its a variable so the name returned from getcurrentfield(mygroup) is =$(eCalcDimension1) but the issue is the same if the calculated dimension has quotes, I can't find a way to correctly compare what is returned from getcurrentfield(mygroup)

Not applicable
Author

WAIT!! Ok so I've figured it out for variables, since my calculated expression is a $ expansion and the only reason I cant properly compare it to the return result of getcurrentfield(mygroup) is because the name has a $() in it and wants to evaluate the expression I simply purgechar(getcurrentfield(mygroup), '$')  and compare it to '=(eCalcDimension)' adn it WORKS!!

Thanks for the reply 😃 it sparked my own solution.