# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
New Contributor III

## 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

Tags (1)
2 Replies
Highlighted
Esteemed Contributor III

## Re: Dimension based on a "if" condition

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)

Highlighted
Valued Contributor

## Re: Dimension based on a "if" condition

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.

[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