Deleting files from mac but not from iCloud
How to delete files from my mac and keep it in iCloud Drive?


You cannot do this, because...

iCloud is a syncing platform and not primarily a backup platform.  


  iCloud connects you and your Apple devices in amazing ways. It makes sure you always have the latest versions of your important information—like documents, photos, notes, and contacts—on whatever device you’re using. It lets you easily share photos, calendars, locations, and more with friends and family. It even helps you find your device if you lose it.


It's designed to give you access to your files from all your devices.  It's not designed to allow you to put a file there and then delete it from your device.

If you need an actual backup solution, you should look to Google, Dropbox, or OneDrive.  They'll allow you to do the file backups you need.