
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If expression using Variable
Hi Everyone
I am trying to create a master dimension. I am using If statement which Includes Variables. so below statement means if Material subgroup is 'RawMaterial' and any Country in China_Manufacturer Variable then result should be China ,if Material subgroup is 'SemiFinished' and any Country in China_Vendor Variable then result should be China,if Material subgroup is Finished and any Country in India_Vendor then result should be India else ROW.
Below is the statement
=IF(MaterialSubGrouping='RawMaterial' AND {'$(China_Manufacturer)'},'CHINA',
IF(MaterialSubGrouping='SemiFinished' AND {'$(China_Vendor)'},'CHINA',
IF(MaterialSubGrouping='Finished' AND {'$(India_Vendor)'},'INDIA','ROW')))
China_Manufacturer, China_Vendor,India_Vendor these are Variables
China_Manufacturer ='KR' OR 'ID' OR 'TH' OR 'CN' OR 'HK' OR 'JP' OR 'SG' OR 'TW'
China_Vendor='KR' OR 'ID' OR 'TH' OR 'CN' OR 'HK' OR 'JP' OR 'SG' OR 'TW'
India_Vendor='IN' OR 'ZA'
but below error is popping up
Error in expression
Error in expression:')' Exprected
If anyone can resolve this it will be of great help.
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
your syntax is off, this
{'$(China_Manufacturer)'},
is normally used in set analysis and not inside an if expression. look at the wildmatch function, that may be what you need:
wildmatch - script and chart function ‒ Qlik Sense on Windows

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Edwin,
Should I remove all variables from Expression?could you please help me with the expression?
Thank you.
