Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dimension based on a "if" condition

Hello,

I have the following table :

IDEntry date new fileEntry date old file

I would like to add a new dimension : "Deleted" that will show "deleted" if the entry date in the new file is empty or if the entry date in the old file is empty. I tried to create a new dimension directly in the visualisation with the following expression :

- =If((IsNull(Sum([New Total Date début])) OR IsNull(Sum([Old Total Date début]))),1,0)

But it is not working.

Where and how can I create a new dimension ?

Thanks,

Caroline

2 Replies
Chanty4u
MVP
MVP

try this

=If((IsNull(Sum([New Total Date début])) OR IsNull(Sum([Old Total Date début]))=' ',1,0)

or

=If((IsNull(Sum([New Total Date début])) OR IsNull(Sum([Old Total Date début]))='-',1,0)

christophebrault
Specialist
Specialist

Hi Caroline,

When you want to add a dimension, the easiest way is to create it in your script as a new field in your table.

in your LOAD you can do :

LOAD ID,

           [Entry date new file],

           [Entry date old file],

           if(len([Entry date new file])=0 or len([Entry date old file])=0,1,0) as Deleted

FROM ...

I test if dates are null with the len() function instead of isnull().

ps:

Il y a un groupe des utilisateurs francophone plutôt actif où tu trouveras de l'aide pour poser des questions, en français :

Groupe des Utilisateurs Francophones

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin