> For the complete documentation index, see [llms.txt](https://docs.corraldata.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.corraldata.com/kb/chat-with-your-data/ask-multi-layered-questions.md).

# Ask Multi-layered Questions

Sometimes your business question is too complex for AskCorral to answer in one go — especially if it spans multiple sources, datasets, or stages in the funnel. AskCorral works best when you ask **smaller, focused questions first**, then combine them into a final, synthesized prompt.

Example: *“What is the cost per SQL from paid LinkedIn campaigns targeting enterprise leads in Q2, and how does that compare to Q1?”*

#### This question involves four different layers:

1. Spend from LinkedIn Ads
2. Leads filtered by campaign and segment
3. Funnel progression to SQL
4. Time-based comparison

Trying to write this all at once may fail or return the wrong results. So, break it down.

### How it works:

**Understand spend by asking:** “*What was the total LinkedIn Ads spend for Q1 and Q2?”*

**Get lead counts by asking:** *“How many leads came from LinkedIn Ads in Q1 and Q2?”*

**Filter to enterprise leads by asking**: *“How many of those LinkedIn leads were from enterprise accounts?”*

**Funnel progression to SQL by asking:** *“Of those enterprise LinkedIn leads, how many became SQLs in Q1 vs Q2?”*

**Synthesize all data with the prompt:** *“What was the cost per SQL for LinkedIn enterprise leads in Q1 and Q2?” (Use previous answers: divide spend by SQL count.)*<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.corraldata.com/kb/chat-with-your-data/ask-multi-layered-questions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
