Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm new to QlikView and I would like if somebody could explain my problem to me.
I want to create specific columns in calculated dimension based on some rules.
If I use fields which are unique everything works. But if I use the field again with condition it doesn't work.
Does it mean that in dimension you can select field only once?
Please see below. If I run this I get only 3 columns. One for F+I, second for Distributor and third for Others.
F Distributor won't show.
=if(Match(Customer, 'France', 'Italy'), 'F+I',
if(Match(Type, 'Distributor'),'Distributor',
if(Match(Customer, 'France') and(Type = 'Distributor'),'F Distributor','Others')))
It will never get to that point because "France" will always return a match in the first If(), so it will always stop at 'F+I'.
Perhaps you should use If() instead of Match():
=If(Customer = 'France' AND Type = 'Distributor',
'F Distributor',
If(Customer = Italy OR Customer = 'Italy',
'F+I',
'Others'
))
(check syntax, wrote from memory).
For the sake of performance and maintenance, I try to reduce as much as possible any calculated dimensions, creating new fields or flags if I need so in the script. You could also apply this logic in the LOAD script, store it as a different field and use it in the chart instead.