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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

No hard coding for an exception

I have completed my data modelling., Now I need to add one exception condition that for certain countries, for certain list of products, manfucturer should be X not Y. It can be easily done by hard coding which I am not allowed. Can someone please suggest a better way?

Ex. If I select country like JAPAN, and product as ' CAMERA 1', the manfucture always comes as CANON. Which I want to change to NIKON.

1 Solution

Accepted Solutions
ToniKautto
Employee
Employee

I would consider the examples you show as dimensional data, and as such you should not try to generate non-existing relation in the front end objects. Solving this in the data model is the easiest and most reliable way. It does not mean you have to change the existing data but add a new field with the "alternative dimensions". Technically you might be able to use a mapping table to solve it.

View solution in original post

5 Replies
ToniKautto
Employee
Employee

I would consider the examples you show as dimensional data, and as such you should not try to generate non-existing relation in the front end objects. Solving this in the data model is the easiest and most reliable way. It does not mean you have to change the existing data but add a new field with the "alternative dimensions". Technically you might be able to use a mapping table to solve it.

danieloberbilli
Specialist II
Specialist II

if you just want to show this label eg. in a straight table, you could use a simple if-then expression: e.g.

if(GetFieldSelections(Country)='Japan' and GetFieldSelections(Product)='Camera 1', 'Nikon', Product)

but this can get quite complex depending how much exceptions you have...so Toni's approach is much better

Anonymous
Not applicable
Author

Thanks Toni!! It helped.. I was trying mapping table.. but I wasnt including the new alternative dimension. I was just using the alternative dimension as a Field to link. Your explanation made me clear where i went wrong!

Anonymous
Not applicable
Author

Hi Toni..

I used this method but I am fcing another issue. the alternatice dimension does have new values, but the associated values do not change.

Eg. If I changed the Manufacturer from X to Y, It does show Y for that country and product, but the coressponding values like Corporation Desc, Corp ID , Mfr ID do not change. And I canot add so many fileds into Mapping table as the data is huge and does not make sense. Please advice.

ToniKautto
Employee
Employee

My general guess is that you need to work on the data model further to cater for your needs and requirements. In this case I guess you are basically just adding a new label, and the data is still associated to the old label. The way to could approach that depends on what your data model looks like.

I'm not sure I fully understand you data model and expected outcome. A simple sample would help me get a better understanding of your scenario.