Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Is there a restriction for calculated dimension?

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')))

1 Reply
Miguel_Angel_Baeyens

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.