'How do i convert my data into numeric data on pgAdmin4 . I keep getting the same error

I'm fairly new to SQL but i cant find a solution the following problem. Ive made some tables in pgAdmin4 and put in a CSV file containing the data for the tables. I want to replace the X and Y data to numeric data but i keep on getting the same error while i make slight adjustments to the code:

select distinct replace("X",',','.')::numeric, replace("Y",',','.')::numeric
from dataset_raw 

The error that I receive is:

ERROR: invalid input syntax for type numeric: "6.171.983.937"
SQL state: 22P02

in this picture it shows the result i want to achieve



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source