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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

reverse function qliksense

hi,

i'm trying to use reverse function in qliksense script but load fails (not supported function).

in the app as a calculated dimension it gives an error expression...


reverse(Field2) as Reverse_Field2 (is that the correct syntax)


any ideas?

1 Reply
felipedl
Partner - Specialist III
Partner - Specialist III

Hi ilan,

There is no reverse function in qlik string functions.

See the link for the available string functions:

String functions ‒ Qlik Sense

Maybe you used this link as reference:

Reverse a value

But sense doesn't use macro as Qlikview.

As an alternative, you'd have to do in in code, something like the below script:

x:

Load * Inline

[

Desc

I like Qlikview!

];

let vString = peek('Desc',0,'x');

let vLen = Len('$(vString)');

let vStringNew = '';

for i = 1 to Len('$(vString)')

vStringPart$(i) = Mid('$(vString)',$(i),1);

next;

let i = Len('$(vString)');

do

let vStringNew = '$(vStringNew)' & '$(vStringPart$(i))';

trace $(vStringNew) $(i);

i = i -1;

loop while i > 0;

data:

Load

'$(vString)' as Original,

'$(vStringNew)' as Reversed

AutoGenerate(1);

drop table x;

You could use the code i've done and use it as a sub called reverse to do this trick for you.

To achieve the following reversed string and get it to a table:

Sample.png