Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
j_fulcher
Partner - Contributor
Partner - Contributor

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
miskinmaz
Creator III
Creator III

Can you post the output you are getting along with the input data
j_fulcher
Partner - Contributor
Partner - Contributor
Author

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. 

 

 

antose
Partner - Creator II
Partner - Creator II

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

verbatrim.PNG

j_fulcher
Partner - Contributor
Partner - Contributor
Author

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.