![External User - Sachin Sharma (Customer)](https://community.tableau.com/img/userprofile/default_profile_45_v2.png)
Sachin Sharma (Member) asked a question.
Hey VizFam!
I hope you're all doing well! I wanted to share an interesting challenge I recently encountered while working with a live connection to a MongoDB Atlas federated view in Tableau. I've managed to set up the connection successfully, and I can access my files without any issues. However, I've hit a snag—some of the fields in my dataset are nested arrays, maps, and objects, which is causing Tableau to throw errors when I try to pull them into rows and columns (live connection mode)-
While using extract -
Here's where I need your insights: I know that to make this work, I need to parse or flatten the data, but I'm uncertain about the best approach. I’m considering a few options:
1. **Using aggregation pipelines in MongoDB Compass**
2. **Leveraging Tableau Prep or Desktop**
3. **Exploring other ETL tools**
If any of you have navigated this issue before and found a solution, I would love to hear your thoughts! Please share your experiences and detailed advice on what worked for you. Thanks so much in advance for your help! Our goal is to maintain a live or near real-time connection with the MongoDB federated view, and I'm excited to collaborate with you all on this!
Cheers!
Hi Sachin,
You may want to try FLATTEN / UNWIND the nested structures right in Tableau by using the Custom SQL like this:
where <datasource> is your original one (converted to the Custom SQL),
<integer> is the depths of the nesting (choose the max one of any column),
<string> is the delimiter used in the nested docs.
UNWIND has slightly different syntax, but the attempt would be the same.