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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
SimonDB
Contributor III
Contributor III

Reference Valuelist() Dimension value same as Column()

Hi, I want to reference in a table the actual value of a dimension in another column and create a calculation based on that referenced value.
I know how to do this if the dimension column comes from a pre-loaded field, HOWEVER, I'm loading the dimension value from a "Valuelist()"

Dimension: =valuelist('Car','Bicycle','Boat','Bus','Moped')

Measure: =pick(match(([$(=Replace(GetObjectField(0),']',']]'))])

          ,'Car','Bicycle','Moped','Bus','Boat')

          ,1,2,3,4,5)

SimonDB_0-1791371676848.png

The formula in the measure column works if the dimension is pre-loaded but not from a valuelist

Any help will be gratefully received, thank you.

Labels (3)
1 Solution

Accepted Solutions
henrikalmen
Specialist II
Specialist II

GetObjectField just gives you the valuelist expression. Perhaps this is what you want: 
=pick(match(valuelist('Car','Bicycle','Boat','Bus','Moped'),'Car','Bicycle','Boat','Bus','Moped'), 1, 2, 3, 4, 5)

henrikalmen_1-1791375951788.png

 

View solution in original post

3 Replies
henrikalmen
Specialist II
Specialist II

GetObjectField just gives you the valuelist expression. Perhaps this is what you want: 
=pick(match(valuelist('Car','Bicycle','Boat','Bus','Moped'),'Car','Bicycle','Boat','Bus','Moped'), 1, 2, 3, 4, 5)

henrikalmen_1-1791375951788.png

 

SimonDB
Contributor III
Contributor III
Author

Thank you, that is so obvious now you typed it. Again thanks

marcus_sommer
MVP
MVP

I suggest to rethink the approach and using (nearly) always native dimensions. They might be kept within island-tables in the data-model.

This has multiple benefits like being able to use them within aggr(), TOTAL or SET statements, providing a significant better performance, could be extended by further grouping fields and probably some more ... If any possible calculated dimensions should be avoided.