Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to display the label of calculated dimension

Hello,

I am trying to display the label of current selected field of a Group.

Is it possible?

Thank you,

Maria

1 Solution

Accepted Solutions
sunny_talwar

See if the attached is something what you wanted to do?

Variable will take this value '=' & 'date([Order Date], ' & Chr(39) & 'M/D' & Chr(39) & ')'

and use the variable with dollar sign expansion like this If(GetCurrentField(Group) = $(Variable)...

Best,

S

View solution in original post

12 Replies
sunny_talwar

I am guessing that you need to find the current field name from your Cyclic or Drill Down group. If this is what you are looking to do then you can use GetCurrentField function: GetCurrentField(Group_Name).


In case this is not what you want, I would ask you to elaborate a little more.

HTH

Best,

S

Not applicable
Author

Hi sunindia,

Yes, I have a group of dimensions.

What I want to display is the labels of each dimension, not field name.

One of my dimensions is calculated using formula =date(Report_date, 'M/D')

Using GetCurrentField function returns right the formula above.

Thank you for reply,

Maria

sunny_talwar

Oh okay, sop instead of seeing the formula, you want to give it a label. You can do this where you create the group. Please take a look at the below image

Hope this is what you want.

Best,

S

Not applicable
Author

Hi sunindia,

That's right what I need, to have the label displayed for each field from the group.

Each of the field in my group have labels.

Using GetCurrentField() returns the original name of the field/formula for calculated expression.

Thank you,

Maria

sunny_talwar

No don't use GetCurrentField(), instead use the name for your fields (for example for your calculated field '=date(Report_date, 'M/D')' use the label Report Date)

Not applicable
Author

Hi sunindia,

What I want to accomplish is to get in the title of an object the label of the current field of the group.

Is there any way to do that.

Thank you,

Maria

sunny_talwar

For instance if you have these three fields in your group(Group_Name)

Region

Country

=date(Report_date, 'M/D')


Create a variable vVar

'=date(Report_date, 'M/D')'


You can use this for the objects label:

If(GetCurrentField(Group_Name) = '$(vVar)', 'Report Date', GetCurrentField(Group_Name))

This might work for you. If it still doesn't give you what you are looking for, can you post a sample application?

Best,

S

Not applicable
Author

Hi sunindia,

I get the same result even using a variable for calculated dimension in dimension group.

Attached is my example.

I could just load the new field with the format I want expression included in Dimension Group. However, I think it should be a way to chose between current field name and current field label.

Many thanks again,

Maria

sunny_talwar

See if the attached is something what you wanted to do?

Variable will take this value '=' & 'date([Order Date], ' & Chr(39) & 'M/D' & Chr(39) & ')'

and use the variable with dollar sign expansion like this If(GetCurrentField(Group) = $(Variable)...

Best,

S