Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
FreeBI
Contributor II
Contributor II

How to replace a hyphen by a blank value in script?

Hi Qlik community,

I am hoping you could help me with my issue I have been struggling with for so long now.

I use Qlik Sense. There are certain dimensions in Qlik Sense that have '-' . I checked whether these were null values by writing isnull(filedname). The non-null values returned Blank (what was expected) and '-' values returned '-'? 

I need these hyphens to have the 'Blank' value because I am applying some applymaps to calculate an additional column.

How do I convert them to be 'Blank' instead of being hyphen?

Thank you so much in advance!

 

4 Replies
FreeBI
Contributor II
Contributor II
Author

I already had a look at the existing posts regarding the same issue ,and it is not working for my case.
stevejoyce
Specialist II
Specialist II

doesn't isnull() return true/false.  Not sure why you are saying it returned blank or '-'... so i may not be understanding your question.  you want to treat hyphen as null, like this?...

isnull(if(fieldname='-',null(),fieldname))

FreeBI
Contributor II
Contributor II
Author

I am applying a  condition : If(isnull(Process), 'Blank', Process) as Process

I am calculating another field based on that one where I do applymaps based on that PRocess field and for some records this field has hyphen as value because there are no values associated. I would like to replace this hyphen by 'Blank' or null to be able to take those lines into account in my calculated field. let me know if you would need more details.

stevejoyce
Specialist II
Specialist II

Ok that makes more sense.  So did what I sent work?  This is easier to read:

If(isnull(Process) or Process = '-', 'Blank', Process) as Process