Asaduzzaman Robin
Asaduzzaman Robin

Reputation: 27

How I extract number from text in Google Data Studio?

I tried this but it's still showing null as you can see in the screen. Please help to solve this.

REGEXP_EXTRACT(X,"[0-9]*[0-9]")

Extract number from text

Upvotes: 1

Views: 3307

Answers (1)

Nimantha
Nimantha

Reputation: 6472

It can be achieved using the Calculated Field below which uses the REGEXP_EXTRACT function to extract the numbers and the CAST function to ensure that it's a Number field:

CAST(REGEXP_EXTRACT(Attività, "(\\d+)") AS NUMBER )

Google Data Studio Report and GIF to elaborate:

Upvotes: 1

Related Questions