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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set variable as seperator

Hi all - This one is bugging me but I know one of you experts will get it straight away!

I am concatenating two fields together into one new field in my load script, such as Company Code and Company Name.  i.e.

    

CompCode & '-' & CompCodeDesc as CompKeyandTxt

Which gives the user the user the key and text in one field seperated by -

What I want to do is have a variable on the main tab which defines what character the seperator is so that I only need to change it once if the users decide they want a comma or space or anything else as the seperator.

I've tried:-

set vSeperator = '-';
    

CompCode & $(vSeperator) & CompCodeDesc as CompKeyandTxt

and numurous other variations without success.

Can anyone help?

Many thanks in advance.

Sean.

1 Solution

Accepted Solutions
Not applicable
Author

load X & '$(vSeperator)' & Y AS TEST

You forget the quotes !

View solution in original post

3 Replies
Not applicable
Author

load X & '$(vSeperator)' & Y AS TEST

You forget the quotes !

Anonymous
Not applicable
Author

Sean,

Try this:
let vSeperator = chr(39) & '-' & chr(39);

Regards,
Michael

Edit: I changes set to let

Not applicable
Author

Excellent!  Thanks both!