I have a dimension (a column from google sheets) called products with the following values:
product = [apple , apple_old_2019, pineapple , pineapple_old_2020, pineapple_old_2017 ...]
I need to regex then and remove the pattern old_**** and then aggregate the values by name.
In Google Sheets I would replace the values and then use the Unique formula, but in Google Data Studio there isn't such function.
I created a custom field called Product_pre with this formula:
REGEXP_EXTRACT(Product , '^(.+?)(_old_[0-9]{2}-[0-9]{4})' )
Then I created another custom field with the following formula:
CASE
WHEN Product_pre_process is null THEN Product
ELSE Product_pre_process
END
The problem is that the result has duplicated values:
product_processed = [apple , apple, pineapple , pineapple, pineapple ...]
How could I fix that?
