Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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.

Tags (3)
1 Solution

Accepted Solutions
Not applicable

Re: Set variable as seperator

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

You forget the quotes !

3 Replies
Not applicable

Re: Set variable as seperator

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

You forget the quotes !

mov
Esteemed Contributor III

Re: Set variable as seperator

Sean,

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

Regards,
Michael

Edit: I changes set to let

Not applicable

Re: Set variable as seperator

Excellent!  Thanks both!

Community Browser