Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replace one single character from all columns

Hi All,

I have a requirement,In my table  I want to replace \n character with null() from all column.

I can use if condition

if(Col1='\n',null(),Col1) as Col1

But in my table there are above 100 coumn. So is there any alternative let me know..

1 Solution

Accepted Solutions
Gysbert_Wassenaar

If you're loading data from text files or excel files you can use the NullInterpret variable. If you add this line at the beginning of your load script then all \n values will be replaced with nulls:

set NullInterpret='\n';


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi Sumita,

It is better to replace manually by using the If, instead of doing dynamically. 

Regards,

Jagan.

Not applicable
Author

Hi ,

In my case I am fetching the data from text file and manually is not possible because there are several  column.

And then i have to use the data for further calculation.

jagan
Luminary Alumni
Luminary Alumni

Hi,

You have to use this

if(Col1='\n',null(),Col1) as Col1

for all the columns.  I think this is the best option when comparing to do this dynamically, it needs lot of scripting and it leads to performance issues.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi,

Yes i was initially using that but as i mentioned that in my table there are more than 100 column, in which it is not possible and exactly it will degrade the performance.

Thatsy I am looking for alternative solution.(like loop which read my column name and apply that condition. )

Because \n is coming in approx all column.

Not applicable
Author

Sumita,

please provide an example we can work with (example.qvw or Excel).

Thank you!

Rainer

Gysbert_Wassenaar

If you're loading data from text files or excel files you can use the NullInterpret variable. If you add this line at the beginning of your load script then all \n values will be replaced with nulls:

set NullInterpret='\n';


talk is cheap, supply exceeds demand
Not applicable
Author

Thanku Gysbert.

It is working fine.