Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

an expression in a dimension created


Not knowing whether I have to write in English or in French, I shall start in English since I am relatively new to Qlik Sense and certainly new to this forum.

I am trying to write an expression into a dimension I have created. after a 1st success, I was hoping that what comes next would be easy !

- I went into th creation of a sheet mode ;

- in the left pane, I went into "Eléments principaux" tab ;

- I went into dimensions and created a new element ;

- in the "edit the dimension" box, I made sure the "Unique" radio button was clicked ;

- in the name field, I called my dimension :  Hors_délai_pour_SFR ;

- then I went into the expression editor ;

- and I wrote :         if ([Contrat] = 'CONTRAT MSN SFR', 'OK', 'NOK')

- Then, in a table, I made sure I had the column [Contrat] ;

- i filtered my table to bring out the lines where [Contrat] = 'CONTRAT MSN SFR'

- after adding the dimension newly created "Hors_delais_pour_SFR" as a column in the table, I expected to see the value 'OK' appear in it.

- The value 'NOK' appears however, like if the test   ([Contrat] = 'CONTRAT MSN SFR'   did not work

I don't have any "compiling" errors appearing in the editor when writing my expression. So my guess is I wrote someting different to what I believe.

Could you pleasee tell me how am I supposed to write this expression ?

Best Regards, Patrick

Tags (1)
1 Reply
Not applicable

Re: an expression in a dimension created

I have looked at my expression and tried to write it in a different way, with a "pick/match" expression. To do this I have taken what I had written bit by bit and found out what my error was.

if ([Contrat] = 'CONTRAT MSN SFR', 'OK', 'NOK') => that looks for the chain of character containing 'CONTRAT MSN SFR', when I should have been looking for 'CONTRAT NSN SFR'

A small error in typing that makes a great difference, but that easy to find wghen one does not know whether I was looking for a syntax error or a error of logic. That's the pleasure of breaking a new tool I guess.