Skip to main content
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
MoeyE
Partner - Creator III
Partner - Creator III

Transformation to make 0's appear as NULL in target

Hi,

I was wondering how to make the target columns appear as NULL if the source value is a zero. I don't want them to remain as zero in the target.

Any guidance with this is appreciated.

Kind regards,

Mo

Labels (1)
1 Solution

Accepted Solutions
MoeyE
Partner - Creator III
Partner - Creator III
Author

Hi,

Thx everyone for the helpful responses. I didn't word the original question correctly, my original intent was to insert a NULL value if the length of the value in the column is 0. So this was my final expression:

MoeyE_0-1702333604646.png

 

Regards,

Mo

 

View solution in original post

4 Replies
SachinB
Support
Support

Hello @MoeyE ,

Please try the below in expression builder in order to replace 0 with Null

replace($EMPLOYEE_ID,"0","Null");

 

Regards,

Sachin B

 

john_wang
Support
Support

Hello Mo, @MoeyE 

I'd like to confirm the behavior for you. Do you mind to share what's the source and target databases type?

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Heinvandenheuvel
Specialist III
Specialist III

@MoeyE  this works for me Oracle to Oracle . replace with your column name and test value:

case when $TXT = 'beans' then null else $TXT end

 

@SachinB  replace($EMPLOYEE_ID,"0","Null");

Did you try? That would put the STRING 'NULL' out there, Surely @MoeyE wants it to become a null value - 'nothing'

If you want to be cute, then for certain targets you could replace with '<att_null>' or 'attNULL' and the CSV intermediate file handling for CDC might just replace those with NULL values on target. 🙂

Hein

MoeyE
Partner - Creator III
Partner - Creator III
Author

Hi,

Thx everyone for the helpful responses. I didn't word the original question correctly, my original intent was to insert a NULL value if the length of the value in the column is 0. So this was my final expression:

MoeyE_0-1702333604646.png

 

Regards,

Mo