Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

ilanbaruch
Contributor

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
Valued Contributor III

Re: reverse function qliksense

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