Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
Partner
Partner

Displaying leading spaces in field selection box

Hi All,

I have a field within my data set in which some entries have leading spaces. I have used 

SET Verbatim=1; 

to ensure that these leading spaces are loaded when I rerun the script.

However, when I display this field in a table or a field selection box the leading spaces are automatically trimmed. Is there a way to retain these leading spaces when displayed in a visualisation?

Thanks in advance for any help.

4 Replies
Highlighted
miskinmaz
Contributor II

Re: Displaying leading spaces in field selection box

Can you post the output you are getting along with the input data
Partner
Partner

Re: Displaying leading spaces in field selection box

My input data for the field in question looks like this:

A

    A.1

          A.1.1

          A.1.2

B

    B.1

    B.2

C

etc...

 

However when I display the field in a selection box or table the leading spaces are removed so it looks like this:

 

A

A.1

A.1.1

A.1.2

B

B.1

B.2

C

 

I am hoping to keep the leading spaces as it provides a nice visual structure to the selection options. 

I know that the data is being loaded with the spaces included because if I use the len() function the spaces are being counted, it is only when the field is displayed in a visualisation that the spaces seem to be trimmed. 

 

 

Partner
Partner

Re: Displaying leading spaces in field selection box

Hi! I tested in version February 2019 (desktop) with this results

verbatrim.PNG

Partner
Partner

Re: Displaying leading spaces in field selection box

Thanks for the reply,

That is exactly what I am looking for. I am limited to the Nov 17 release at the moment so perhaps that is part of the problem?

I have found a workaround by replacing the spaces in the excel file from which the data is loaded with '.' and then using  

replace([FieldName],'.',chr(15))

in the script to replace the '.'s with spaces which has given the desired effect.

Ideally I would prefer to not have to perform this middle step of replacing spaces with '.'s.