Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Access Current Dimension/Expression Name within Formula?

Hiya Guys,

I have created a formula which, given the name of a Dimension (for example) returns whether or not the Dimension exists in the currently selected criteria:

fnIncludeDim: If (GetSelectedCount(_Dims)>0, SubStringCount(uvDimensions, $1 & ';'), 0)

My initial idea was to include this formula (parameterised variable) under each Dimension's "Enable Conditional" field:

=$(fnIncludeDim('TimelineDate'))

This works great - and basically allows me to create a dynamic Straight Table based on which Dimensions the User has selected from a List Box.

However, with many Dimensions (and with a view to making my Dashboard as "generic" as possible so I can reuse it with other datasets) - my question is:

Is there any way to reference the name of the current Dimension from within a formula?

For example, the above "Enable Conditional" formula would become something like (pseudocode!):

=$(fnIncludeDim($CurrentDimensionName))

This way I would be able to use the same formula (variable) for each Dimension, and the "Dimension Name" parameter would be automatically calculated for each Dimension and passed without having to hard-code it for each field.

Hopefully my question makes sense... I realise the answer is probably "No" - but I thought I'd ask you lovely people in case any of you have any ideas  🙂

Cheers,

Steve.

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I've been wishing for this feature to exist for years! Something like a function this() or ThisDimension() or ThisExpression() - wouldnt' it be wonderful?

Unfortunately, as far as I know, it doesn't exist - I'd love to be wrong on this one!

View solution in original post

5 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I've been wishing for this feature to exist for years! Something like a function this() or ThisDimension() or ThisExpression() - wouldnt' it be wonderful?

Unfortunately, as far as I know, it doesn't exist - I'd love to be wrong on this one!

Not applicable
Author

Thanks Oleg,

Yes, that's exactly what I require - it would be very useful!

I think you might be right - but I'll hang-fire for a little while longer in case anyone else has any insight... keep your fingers crossed!  🙂

Cheers,

Steve.

Not applicable
Author

*BUMP*  🙂

No one else with any ideas?

cheers,

Steve.

Not applicable
Author

Hiya Oleg,

Perhaps you and your colleagues could vote for this:

I thought, as it wasn't just my idea, it was worth requesting  🙂

Cheers,

Steve.

Not applicable
Author

You can use GetObjectField. GetObjectField takes the index of the dimension that you want, e.g, 1 for the first. The indexes are absolute, i.e., 1 will always return the first dimension regardless if it's enabled or not.