Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
AIShatiLove
Contributor III
Contributor III

Remove all separators but the last one

Hi

I have a problem.  In file i have a  number-column  where comma and dots are separators. And they are mixed up

i have :  1,205.34  ;  15,05 ;  12.64 ;  504,63 ... etc.

How i can Remove all except the last separator in qlik load ,  to get numbers as : 1205.34; 15.05; 12.64; 504.63  etc 

Labels (1)
13 Replies
PrashantSangle

what is your expected output in above scenario.

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
AIShatiLove
Contributor III
Contributor III
Author

i want to get only one decimal separator   :    1205,34  ;  15,05 ;  12,64 ; 3504,63  or   1205.34  ;  15.05 ;  12.64 ; 3504.63

should there be a comma in the qlick ?

PrashantSangle

after decimal separator, do you always have only 2 numbers or there is possibility to have more than 2 numbers
=Left(PurgeChar(fieldName,',.'),len(PurgeChar(fieldName,',.'))-2)&','&right(PurgeChar(fieldName,',.'),2)

or

=Left(PurgeChar(fieldName,',.'),len(PurgeChar(fieldName,',.'))-2)&'.'&right(PurgeChar(fieldName,',.'),2)

 

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
AIShatiLove
Contributor III
Contributor III
Author

thank you for your reply, but after decimal separator values can have 1 or 2 numbers not always 2 . Or they might be integer without any separators
i tried you solution, but it only works with numbers that have 2 num after decimal, if number has 1 digit after decimal i get   " .47 " instead "4.7"

 

PrashantSangle

chk this,

 

=Left(PurgeChar(fieldName,',.'),len(PurgeChar(fieldName,',.'))-if(index(fieldName,'.')>index(fieldName,','),len(fieldName)-index(fieldName,'.'),len(fieldName)-index(fieldName,',')))
&'.'&
right(PurgeChar(fieldName,',.'),if(index(fieldName,'.')>index(fieldName,','),len(fieldName)-index(fieldName,'.'),len(fieldName)-index(fieldName,',')))

 

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
AIShatiLove
Contributor III
Contributor III
Author

thank you, it works better, but it still couldn't correctly transform integer number,  i get "123.4" instead "1234"

PrashantSangle

it is working as per your requirements. & how became 123.3 became 1234? what is logic behind it.

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
AIShatiLove
Contributor III
Contributor III
Author

mean *"123.4"

this is what how my raw data looks like

AIShatiLove_0-1614334749498.png

 

AIShatiLove
Contributor III
Contributor III
Author

I attached the file in the header with the data for a more detailed understanding