Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mattphillip
Creator II
Creator II

Re-ordering field values containing a space

Hoping someone can help. I've previously used the below script to re-order field values for charts I have to produce and it works fine. However, I now have a field value (Very Often) with a space and whilst the script will reorder the other values, it won't touch this one. I've tried single quotes, double quotes and brackets and none work. Any ideas?

tmploadorder:

load * Inline [

Memorising

'Very Often'

Often

Sometimes

Never

N/A

];

LOAD Institution,

     [Code Ref.],

     StageHEA,

     GenderHEA,

     DomicileHEA,

     ModeHEA,

     LevelHEA,

     AgeHEA,

     Memorising,

     Applying,

     Analysing,

     Evaluating,

     Forming,

     [Changes to work],

     [Challenged by course],

     [Prepared for sessions],

     [Worked with other students],

     [Explained course material],

     [Asked another student],

     [Prepared with other students],

     [Asked questions],

     [Discussed performance],

     [Talked about career],

     [Discussed ideas],

     [Worked with teaching staff]

FROM

(qvd);

DROP table tmploadorder;

Any help would be much appreciated.

Matt

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It should work without the quotes. My guess is that the value in the qvd has more than one space between the words?

-Rob

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

It should work as is, have you tryed simply to leave

very often as is?

mattphillip
Creator II
Creator II
Author

That's what I thought but I've tried but it won't update the value order on the chart I'm afraid.

M

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It should work without the quotes. My guess is that the value in the qvd has more than one space between the words?

-Rob

mattphillip
Creator II
Creator II
Author

I've just checked and there is only a single space. This chart is starting to annoy me now.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Leading or trailing spaces? Different case? I find it useful to put values in a listbox with an expression like:

='>' & Memorising & '<'

to check for leading/trailing spaces.

-Rob

mattphillip
Creator II
Creator II
Author

Thanks Rob, no spaces but I did spot that I had capitalised 'often'. Fixed that and it works!

Cheers,

Matt

mattphillip
Creator II
Creator II
Author

Ok, new problem - I can't get the reorder to work with the [Prepared for session] field. I've tried without quotes, with single quotes, double quotes, square brackets and curly brackets with no luck.

Any ideas?

M

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Reload but this time don't drop the temp table. Make a listbox of [Prepared for session] and see if you different variations of similar value.

-Rob