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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kinjal1645
Creator
Creator

Remove empty line from a string

Hello,

I have below expression displaying required data BUT with empty line at the beginning.

How do I remove empty line from the output string of below expression?

concat(distinct if(len([column1])<>0,[column1]&' * '&[column2])&' ' & chr(10))


Kindly help!

Thanks

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

try this?

= Concat(DISTINCT If(Len([column1]) <> 0, [column1] & ' * ' & [column2] & ' '), Chr(10))

View solution in original post

8 Replies
sunny_talwar

Try this

Concat(DISTINCT If(Len([column1]) <> 0, [column1] & ' * ' & [column2]) & ' '), Chr(10))

vishsaggi
Champion III
Champion III

Can you share an example of whats your expected output?

kinjal1645
Creator
Creator
Author

Hello Tanay,

I tried this: Concat(DISTINCT If(Len([column1]) <> 0, [column1] & ' * ' & [column2]) & ' ', Chr(10))

But it did not work, still giving empty line at the beginning.

vishsaggi
Champion III
Champion III

Did you try exactly the expression suggested by Sunny? You are missing a bracket after & ' ')

kinjal1645
Creator
Creator
Author

That seems to be an extra bracket. Hence I mentioned my expression while replying to him

vishsaggi
Champion III
Champion III

try this?

= Concat(DISTINCT If(Len([column1]) <> 0, [column1] & ' * ' & [column2] & ' '), Chr(10))

wdchristensen
Specialist
Specialist

You expression is causing the empty line with the "new line" character. 

concat(distinct if(len([column1])<>0,[column1]&' * '&[column2])&' ' & chr(10))

Try:

concat(distinct if(len([column1])<>0,[column1]&' * '&[column2]), '')

kinjal1645
Creator
Creator
Author

This works! It was the bracket.
Thank you