BGP Filter by communities

So I have never needed to do this so I am asking for assistane.

I have 2 BGP sessions. On both I am receiving full BGP Tables.
But my one peer is actually better for traffic than the other.
So the 2nd BGP provider has given me BGP Communities.

https://cogentco.com/files/docs/customer_service/guide/global_cogent_customer_user_guide.pdf

On Page 20 they give you the communities not for not announcing to.
The specific ones I do not want to export to is NA and BR.
As I have better routes via SACS.

I have individual Out Filters for both transit providers.
So all I want to be-able to do is not have Cogent announce my AS to NA or BR.

And I am a bit confused on how to do that.

I will be greatfull if someone can point me into the right direction.

According to docs you should be advertising with 174:970 community.

Thanks but this is where I am a bit confused is with the config of the filter itself.

Not sure how the Filter itself will look like.

/routing filter
 add  chain=<Your_out_chain> prefix=<your_prefix> set-bgp-communities=174:970