Mixpanel Community Icon

How to Add Multiple Data Points for Event Filtering in SQL

·
·

Hi, How do I add multiple data points for filtering? Similar to in operation in SQL. I want to give a comma-separated input for filtering events.

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To add multiple data points for filtering events in Mixpanel, similar to an IN operation in SQL, you can use the events parameter with multiple values when creating or editing a pipeline. This allows you to provide a comma-separated input for filtering events.Here's how you can do it: When using the Data Pipelines API to create or edit a warehouse pipeline, you can pass multiple events as separate events parameters. This is more efficient than passing them as a single comma-separated string.For example, you can use this format: LBKS--data 'events=event1' \ --data 'events=event2'LBKSThis approach allows you to specify multiple events that you want to include in your export Data Pipelines API.Alternatively, if you're using JQL (JavaScript Query Language) in Mixpanel, you can use the _.map function to pass multiple events as a list in a params object. Here's an example: LBKSparams = { start_date: "2016-01-01", end_date: "2016-01-10", events: ["View Blog", "View Landing Page", "pageview"] };LBKSfunction main() { return Events({ from_date: params.start_date, to_date: params.end_date, event_selectors: _.map(params.events, event => ({event: event})) }); }LBKSThis approach allows you to filter for multiple events efficiently in your JQL query JQL: Create custom queries using Javascript code.By using these methods, you can effectively filter for multiple events in Mixpanel, similar to an IN operation in SQL.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.

  • Avatar of Swarup N.
    Swarup N.
    ·
    ·

    no not filtering by event names, by event property. Let me give you an example. There is a property called city. Now I want to filter out by 100 cities. how do I do that?