Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get the field name of expression in Dimension

Hi every one , Good Morning !

Today I need help in finding the field name of the expression. I created a

1) Bar Chart with

2) Dimension :  a) Region

                       b) =if(Month1=2,'Feb',If(Month1=3,'Mar',if(Month1=4,'Apr',if(Month1=5,'May','Jun'))))     [ Label = Month ]

both the dimension is grouped together and named as Group1.

3) Expression : Sum(Sales)

To get the result : I used =if(GetCurrentField([Group1])='Region','A',if(GetCurrentField([Group1])='Month1','B','C'))

but i did the result B .

30 Replies
Anonymous
Not applicable
Author

HI

use    =only(GetCurrentField(Group1)) to show level name

and for calculated Dimension use variable with name 'Month'

Anonymous
Not applicable
Author

Hi Samane,

If I used this formula =only(GetCurrentField(Group1)) then when i go to month1 section it will give me the expression that i used but I need label not expression for month1 field.

label.jpg

balabhaskarqlik

May be like this:

=GetCurrentSelections('|','=')

=GetFieldSelections(Suppliers.CompanyName)& ‘ – Freight’

sunny_talwar

Try this

=If(GetCurrentField([Group1]) = 'Region','A',

If(GetCurrentField([Group1]) = '=if(Month1 = 2,''Feb'',If(Month1=3,''Mar'',if(Month1=4,''Apr'',if(Month1=5,''May'',''Jun''))))','B','C'))

The quotes in red are two single quotes (NOT a single doube quote)

marcus_sommer

I use usually in such cases a dimension like:

= Expression //ExpressionLabel

and access it then with subfield(getcurrentfield(DimGroup), '/', -1)

- Marcus

Anonymous
Not applicable
Author

No Sunny,

I have tried this earlier also but only A and C I found in result

, not B which I am still in search of.

Anonymous
Not applicable
Author

Hi Marcus,

GetCurrentfield and subfield(getcurrentfield(DimGroup), '/', -1) gave same result..

marcus_sommer

Did you adjust my generic example to your existing group and expression?

Beside them you don't need it mandatory in your case if you creates an extra numeric month-field within the script maybe within a master-calendar: How to use - Master-Calendar and Date-Values.

- Marcus

sunny_talwar

Would you be able to share a sample to check this out?