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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dynamic dimension

hi,

I am trying to create a dynamic dimension based on the possible values of a field. I know how to get the possible values of my field (concat(myfield, ', ')). if i put this in a if like if(concat(myfield, ', ') = 'KBS'), 'hello', 'Bye') it also works fine. I tested this in a textbox. so far so good. if i try this in a pivot table for a dynamic dimension I always get an error. my dynamic dimension looks like this: if(concat(myfield, ', ') = 'KBS', field1, field2)

may someone help me?

regards,

MT

3 Replies
Or
MVP
MVP

concat() is an aggregation function, if memory serves, which means you can't use it directly in your dimension formula. You'd have to wrap it in an aggr() function.

Not applicable
Author

and how would that look?

Or
MVP
MVP

Without knowing what your datamodel looks like,

if(aggr(concat(myfield, ', '),SomeDimension) = 'KBS', field1, field2)

Where SomeDimension is a dimension that will not interfere with your aggregation (if no such dimension exists, you can create something like "Load 1 as SomeDimension" in your script and leave it loose, which should work). There's probably a neater way of doing that, though.