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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jorgie
Contributor III
Contributor III

Dimension Selection Check

Hi to all!

Not a catchy title but there is my issue.

I have the following variable which includes a range of field names.

jorgie_1-1741082741438.png

 

I try to make a expression that checks if the row I have in pivot table is included in the variable.

I use the following expressions

If(Match(GetObjectField(Dimensionality()), SubField('$(vCustomerDimensions)',', ')) > 0, 1, 0)

and

If(WildMatch($(vCustomerDimensions), '*' & GetObjectField(Dimensionality()) & '*'), 1, 0)

 

but the results I get is 0. The three dimensions are included in the variable

jorgie_0-1741082661523.png

 

Thank you in advance for you time and help

 

jT

 

Labels (5)
1 Solution

Accepted Solutions
jorgie
Contributor III
Contributor III
Author

thank you very much!

the solution is combined a previous code i mention with your apostrophes

Meaning 

WildMatch('$(vCustomerDimensions)', '*' & GetObjectField(Dimensionality())&'*' )

 

jorgie_0-1741101607831.png

 

 

need some optimizations for the necessary calculations, but still is the expected result

 

thanks for your time and effort

 

View solution in original post

4 Replies
henrikalmen
Specialist II
Specialist II

Try this:

If(WildMatch('$(vCustomerDimensions)', chr(39)&'*' & GetObjectField(Dimensionality()) & '*'&chr(39)), 1, 0)

jorgie
Contributor III
Contributor III
Author

thanks for replying!

Unfortunately all zer0s.

I tried also 

If(WildMatch($(vCustomerDimensions)chr(39)&'*' & GetObjectField(Dimensionality()) & '*'&chr(39)), 1, 0)

cause vCustomerDimensions is field but still zer0s as result....

henrikalmen
Specialist II
Specialist II

You need apostrophes surrounding the expanded variable. I don't know, perhaps expand getobjectfield as well:

WildMatch('$(vCustomerDimensions)''*$(=GetObjectField(Dimensionality()))*')

(You don't need to wrap your wildmatch in an if-statement, it will return 0 or 1 anyways. Assuming GetObjectField(Dimensionality())) works in this context, perhaps it doesn't...)

jorgie
Contributor III
Contributor III
Author

thank you very much!

the solution is combined a previous code i mention with your apostrophes

Meaning 

WildMatch('$(vCustomerDimensions)', '*' & GetObjectField(Dimensionality())&'*' )

 

jorgie_0-1741101607831.png

 

 

need some optimizations for the necessary calculations, but still is the expected result

 

thanks for your time and effort