{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Products","product_name":"Audience Studio","type":"markdown"},"seo":{"title":"Exporting a Segment As a File","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"exporting-a-segment-as-a-file","__idx":0},"children":["Exporting a Segment As a File"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This procedure assumes that Parent Segment and a batch Segment exist."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open Treasure Console."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to Audience Studio and select the target Segment"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Edit segment rules"]}," button in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Rules"]}," tab",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/exporting-a-segment-as-a-file_image0.813f975bbb4fcaea7cf88d005d7477925a1fa069081bb0ad5dbb539c5fc3afb5.cf3845cb.png","alt":"Tabs for the Segment"},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click the icon like ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["< >"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/exporting-a-segment-as-a-file_image1.3e65d690db26b91875b48626abd27da6fc62cb15fe38fdf7ccffe84992bf7280.cf3845cb.png","alt":"Segment Builder"},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Copy SQL Code"]}," button",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/exporting-a-segment-as-a-file_image2.1332fa0ad0708da04deffbbf4001f4f29113e3252d0e585cf66d53f1486e88de.cf3845cb.png","alt":"Query statement for the Segment"},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open Query Editor and past the query statement"," ","It is recommended that you set the databse described in the query statement for the query.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/exporting-a-segment-as-a-file_image2.1332fa0ad0708da04deffbbf4001f4f29113e3252d0e585cf66d53f1486e88de.cf3845cb.png","alt":"Query Editor with the query statement for Segment"},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you run the query statement with Trino, you will retrieve the content of the Segment"]}]}]}]},"headings":[{"value":"Exporting a Segment As a File","id":"exporting-a-segment-as-a-file","depth":1}],"frontmatter":{"seo":{"title":"Exporting a Segment As a File"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/audience-studio/segment/exporting-a-segment-as-a-file","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}