Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
when using QV i am using a macro code to reverse a string,
how can i do this in Qlik Sense?
because there is no macro in Qlik Sense.
Thanks.
This should work:Reverse string
Thanks a lot Gysbert Wassenaar,
but is there a function you know that i can wrap the field with?
like flip(mytext)?
and if not, is there a way to build something like this?
because if i need to reverse two fields in my table i need to read the table twice,
and by looking at the code the table is expended as the length of "mytext" field and than shranked to her previous size.
Many thanks again.
No and not as far as I know.
Perhaps you can do something like this:
Strings:
LOAD distinct MyText1 as String FROM source;
CONCATENATE (Strings)
LOAD distinct MyText2 as String FROM source;
..etc...
mapStrings:
MAPPING
LOAD String, concat(Letter,'',-row) as ReversedString GROUP BY String;
LOAD String, iterno() as row, mid(String,IterNo(),1) As Letter
While IterNo() <= len(String);
DROP TABLE Strings;
Result:
LOAD
MyText1,
ApplyMap('mapStrings',MyText1) as 1texTyM,
MyText2,
ApplyMap('mapStrings',MyText2) as 2texTyM,
...other fields
FROM
source
;