Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator III
Creator III

Alignment with Concat

Hello All,

I have a concat statement where I  need to show 3 fields in a text box well aligned. Can anyone please help me with this?

Attached is the sample qvw.

6 Replies
Highlighted

You can try this, but this isn't perfect also:

=Concat(DISTINCT Name&'  |  '&Dept&Repeat(' ', Aggr(Max(TOTAL Len(Dept)) - Len(Dept), Dept))&'  |  '&Location,Chr(10))

Capture.PNG

Highlighted

Hi Reshma, you can use something like:

=Concat(DISTINCT Name& Repeat(' ', 20-Len(Name)) & '  |  '&Dept& Repeat(' ', 10-Len(Dept)) &'  |  '&Location,Chr(10))

//Change '20' and '10' the the max length value for each field.

But unsless you use a monospaced font like courier it wouldn't work as each character can have a different width.

Highlighted

What I am doing here is to find the max length of the dept and then repeat an empty space for difference in length of each department.

So, for example, since sales is 5 character long and HR is 2 character, the above expressions adds 3 extra spaces in the text box

Highlighted

Changing it to Courier did help

Capture.PNG

Highlighted
Creator III
Creator III

Thank you for your help Sunny. I am actually trying to implement this in the alert section. My email alerts are unaligned.

Highlighted
Creator III
Creator III

I am actually trying to implement this in the alert section. My email alerts are unaligned.