Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

an expression in a dimension created

Hello,

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

1 Reply
Not applicable
Author

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.

Patrick