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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using find and replace on the tmap

I have a column of numbers, for example: 44,5555 and 234,5039 and 2099,2020. I am trying to figure out how to replace a " , " with a " . " I want to make these three numbers 44.5555 and 234.5039 and 2099.2020 using the tmap.
So far I have not been able to replace the comma with the period and keep the numbers too. Here are some formulas i have tried:
$row1 =~ s/,/./ when i use this i just get back the number < 1 > in all fields.
$row1 =~ s/,/./g when i use this i just get back the number < 1 > in all fields.
$row1 =~ s/,/./ ? "." : "" when i use this i just get back the number < . > in all fields.
$row1 =~ s/,/./g ? "." : "" when i use this i just get back the number < . > in all fields.
If anyone can help me out with this i would appreciate it.
Thanks,
David
Labels (2)
2 Replies
Anonymous
Not applicable
Author

I created this routine
sub filemaskToRegex2 {
my ($filemask) = @_;
my $pattern = $filemask;
# *.log will be used as ^.*\.log$
$pattern =~ s{,}{.}g;
$pattern = ''.$pattern.'';
return $pattern;
}
1;
Anonymous
Not applicable
Author

I created this routine
sub filemaskToRegex2 {
my ($filemask) = @_;
my $pattern = $filemask;
# *.log will be used as ^.*\.log$
$pattern =~ s{,}{.}g;
$pattern = ''.$pattern.'';
return $pattern;
}
1;