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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rotate value in field

Hello,

Suppose I have the following:

LOAD * INLINE [

A, B

1, a1;b2;c3;d4;e5

2, g6;h7;i8;j9;k10

]

;

Is there a function that allows me to obtain

LOAD * INLINE [

A, B,

1, e5;d4;c3;b2;a1

2, k10;j9;i8;h7;g6

]

I have used subfield(B,';'), expanded, added a counter, reversed the order and recombined.

Is there any faster way to do this?

Kind regards,


Antoine

Labels (1)
6 Replies
Anonymous
Not applicable
Author

Solved here..

http://community.qlik.com/message/95968#95968

edit/ partially, unsolved

CELAMBARASAN
Partner - Champion
Partner - Champion

I hope there is no other faster way.

Is the number of values is fixed (i.e., e;d;c;b;a is 5. is it same for all?)

Anonymous
Not applicable
Author

Lol...

No the length is variable unfortunatly.

Did you check the link I have added?
It seems that I can create a custom function to do so.

I am not familiar of creating a custom VBS script and then using it in the load script.

EDIT: Got it. I add it in the VBS script, run the script and then call it within the script.
Quite amazing !!!! this is Gold

Anonymous
Not applicable
Author

Still I have a complete reverse

now i need to figure out how to finetune...

Anonymous
Not applicable
Author


This snippet worked:

Function reverse(t)

r = " "

For i = 1 to ((len(t)-1)/2) step 1

r = r & mid(t,(len(t) - i*2),2)

next

reverse = r

end Function

Anonymous
Not applicable
Author

It is not stable

I keep getting variable results for every reload.

I don't understand why...

has anyone experienced instability using a VB script within the load statement?