Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am getting revered string from my system. For Example Item ABCD is loaded as DCBA.
Is there a function I can use to reverse the string, in the script itself?
Here is the script:
LIB CONNECT TO 'Sandra-Lavi (lavi_sandra)';
Parts:
LOAD
Text(PARTNAME) as Parts.PARTNAME ;
SQL SELECT
PARTNAME,
....
FROM lavi.dbo.PART;
Thanks !!
Sandra
try this:
LIB CONNECT TO 'Sandra-Lavi (lavi_sandra)';
Parts:
LOAD Parts.PARTNAME, concat(Letter,'',-row) as Reversed Group by Parts.PARTNAME;
LOAD
Text(PARTNAME) as Parts.PARTNAME,
interno() as row,
mid(Text(PARTNAME),Iterno(),1) as Letter
While IterNo() <= len(MyText);
SQL SELECT
PARTNAME,
....
FROM lavi.dbo.PART;
I think that better option is Reverse() function of your ODBC. Oracle, MS SQL and Mysql have this funcition.
In Qlik you will need a lot of code.
Try :
Load
MyText,
Concat(Letter,'',-row) as Reversed
Group By MyText;
Load
MyText,
IterNo() as row,
Mid(MyText,IterNo(),1) As Letter
Inline
[
MyText
DCBA
] While IterNo() <= Len(MyText);
Result:
Something like this might work
Table:
LOAD F1,
Concat(F1_Temp, '', -SNo) as F1_New
Group By F1;
LOAD AutoNumber(IterNo(), F1) as SNo,
F1,
Mid(F1, IterNo(), 1) as F1_Temp
While IterNo() <= Len;
LOAD F1,
Len(F1) as Len;
LOAD * INLINE [
F1
ABCD
KLMASL
];
thanks,
I tried applying this to my script but didn't succeed
could you help me apply this to my script?
of course, attach your script
Here is the script:
LIB CONNECT TO 'Sandra-Lavi (lavi_sandra)';
Parts:
LOAD
Text(PARTNAME) as Parts.PARTNAME ;
SQL SELECT
PARTNAME,
....
FROM lavi.dbo.PART;
try this:
LIB CONNECT TO 'Sandra-Lavi (lavi_sandra)';
Parts:
LOAD Parts.PARTNAME, concat(Letter,'',-row) as Reversed Group by Parts.PARTNAME;
LOAD
Text(PARTNAME) as Parts.PARTNAME,
interno() as row,
mid(Text(PARTNAME),Iterno(),1) as Letter
While IterNo() <= len(MyText);
SQL SELECT
PARTNAME,
....
FROM lavi.dbo.PART;
thanks!
I assume you meant to put "PARTNAME" instead of MyText, right?
This is my script now.
and it still bring the reversed text..
Is there something wring with this ?
LIB CONNECT TO 'Sandra-Lavi (lavi_sandra)';
Parts:
LOAD Parts.PARTNAME, concat(Letter,'',-row) as Reversed Group by Parts.PARTNAME;
LOAD
Text(PARTNAME) as Parts.PARTNAME,
iterno() as row,
mid(Text(PARTNAME),Iterno(),1) as Letter
While IterNo() <= len(Text(PARTNAME));
SQL SELECT
PARTNAME
FROM lavi.dbo.PART;
load Text(PARTNAME), iterno() as row, mid(Text(PARTNAME),IterNo(),1) As Letter;
exit Script;