Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to replace second occurrence of a character in string

Hi ,

I have a table called "Technology Versions". It has values like 8.0.5.0.1, 8.1.7.4.1, 11.1.0, 11.2.0.0.0 etc.

For comparing values in this table i need to have consistent data whose values can be compared. I want to remove all dots(.) except for the first occurrence. For example:

8.0.5.0.1 -> 8.0501

8.1.7.4.1 ->8.1741

11.1.0 ->11.10

11.2.0.0.0 ->11.2000


How can i achieve this?

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

=SubField(F1,'.',1) & '.' & SubField(F1,'.',2) & PurgeChar(Mid(F1,Index(F1,'.',2)),'.')

where F1 is your field should solve your needs

View solution in original post

3 Replies
Clever_Anjos
Employee
Employee

=SubField(F1,'.',1) & '.' & SubField(F1,'.',2) & PurgeChar(Mid(F1,Index(F1,'.',2)),'.')

where F1 is your field should solve your needs

avinashelite

please find the attachment for the solution

Clever_Anjos
Employee
Employee

Simpler version: =SubField(F1,'.',1) & '.' & PurgeChar(Mid(F1,Index(F1,'.',1)),'.')