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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mahmad
Contributor II
Contributor II

Use variable within brackets in an expression

Hello,

I'm trying to figure out how to dynamically change text within brackets (variable name within an expression). I have a variable that a user can determine with a dropdown, and this can be either X or Y. I would like to use this value to populate the expressions below:

Aggr(Min({$<[Year] = >}[First Year X]),[%ID])

Aggr(Min({$<[Year] = >}[First Year Y]),[%ID])

I would like to replace X or Y with a variable, but am not sure about the syntax; something like "[First Year " & variable & "]" would be great.

Thanks!

1 Solution

Accepted Solutions
_ylc
Partner - Creator
Partner - Creator

Create your variable for X and Y. Let's call it vTest. Then your formula will be something like this:

=Min($(='[First Year '&'$(vTest)'&']'))

View solution in original post

2 Replies
_ylc
Partner - Creator
Partner - Creator

Create your variable for X and Y. Let's call it vTest. Then your formula will be something like this:

=Min($(='[First Year '&'$(vTest)'&']'))

mahmad
Contributor II
Contributor II
Author

This worked beautifully - thanks!