Skip to main content
Announcements
Happy New Year! Cheers to another year of collaboration, connections and success.
cancel
Showing results for 
Search instead for 
Did you mean: 
mahnoor1279
Contributor III
Contributor III

Compress the long string into short string value

I've multiple values in below column and i need to compress the text into short text which is appeared in first line.

There should not be multiple lines appearing as it's already shown in picture.

mahnoor1279_0-1733306976300.png

 

4 Replies
marcus_sommer

I suggest to check the previous transformation-steps to avoid to handle such output. It looked like some kind of concat() without using distinct.

Beside this you may try string-function to cut them, maybe with the following main-logic against the needed dimensionality:

left(MyString, len(minstring(MyString)))

mahnoor1279
Contributor III
Contributor III
Author

this dimension has multiple records like this how can i use this for other records to replace all the large string if len is greater than the smallest string value

attaching list of values

marcus_sommer

Like mentioned such transformation needs to be performed against an appropriate key-field - which must exists because otherwise these data have no sense. An approach might be:

m: mapping load Key, len(minstring(MyString)) from X group by Key;

t: load *, left(MyString, applymap('m', Key)) as NewString from X;

Muthukumar_77
Contributor III
Contributor III

Hi, Try this,

Mid(DISCREPANCY,1,Floor(Len(DISCREPANCY)/SubStringCount(DISCREPANCY,Mid(DISCREPANCY,1,25))))

Thanks Regards,
Muthukumar P
Qlik Developer