Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
coloful_architect
Creator II
Creator II

Qlik sense load data of # as empty; any solution or walkaround ?

Hi experts,

I am stuck with a load issue that I want to convert all empty values for one dimension into something else like a # at load script section.

what is the code logistic ?

let 's say here is my loading script, in which "contract #" is the dimension contains empty value that I want to replace "#"

 

Contract_Sales:

LOAD
"Contract #",
Cus,
Group

From blah blah....

Thanks

2 Solutions

Accepted Solutions
Kushal_Chawda

@coloful_architect  try below

Contract_Sales:

LOAD
if( len(trim( "Contract #"))=0,'#',"Contract #") as "Contract #",
Cus,
Group

From blah blah....

View solution in original post

Vegar
MVP
MVP

Maybe like this?

LOAD
If(len([Contract #] ) =0,'#' ,[Contract #] ) as [Contract #] 
Cus,
Group

From... 

View solution in original post

6 Replies
Anil_Babu_Samineni

Perhaps

Contract_Sales:

LOAD
'#' as "Contract #",
Cus,
Group

From blah blah....

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
coloful_architect
Creator II
Creator II
Author

I want to clarify a bit.

"Contract #" is a dimension/ a field that includes both empty value and non-empty values.

I want to replace all those empty value with "#" and remain those non-empty values as the same.

Kushal_Chawda

@coloful_architect  try below

Contract_Sales:

LOAD
if( len(trim( "Contract #"))=0,'#',"Contract #") as "Contract #",
Cus,
Group

From blah blah....

Vegar
MVP
MVP

Maybe like this?

LOAD
If(len([Contract #] ) =0,'#' ,[Contract #] ) as [Contract #] 
Cus,
Group

From... 

Vegar
MVP
MVP

If your field only holds numeric values then you could simplify my previous suggestion by using the Alt() function. Like this. 

LOAD
Alt([Contract #] ,'#'  ) as [Contract #]
Cus,
Group

From.... 

Vegar
MVP
MVP

If your empty values are loaded as NULL values in the script then there is another solution to your issue. You can handle the null value straight in the script. Like this

NullAsValue [Contract #] ;

Set NullValue = '#';

LOAD
[Contract #], 
Cus,
Group

From....

Read more on null handling in the links below