how can I generate a report of all my company ids in the format of table with the last login for each company
Hi Juan I., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To generate a report of all your company IDs in a table format with the last login for each company, you'll need to use Mixpanel's Group Analytics feature along with JQL (JavaScript Query Language).
Using Group Analytics
First, ensure you have Group Analytics enabled, which is available as an add-on for Enterprise or Growth plans. Group Analytics allows you to analyze data at a group level (like companies) rather than just individual users.Group Analytics documentation explains that you can establish an event property other than distinct_id, such as company ID, as an identifier to analyze your data.
Creating the Report
You can create this report using JQL in the JQL App. Here's how you would approach it: 1. Use groupByUser()
to group events by company ID
2. Filter for "login" events
3. Track the most recent login timestamp for each companyHere's a sample JQL query that would accomplish this: ```function main() {
return Events({
from_date: "2023-01-01", // Adjust date range as needed
to_date: "2023-12-31" // Adjust date range as needed
})
.filter(function(event) {
return event.name === "login"; // Filter for login events
})
.groupByUser(["company_id"], function(state, events) {
// Initialize state if undefined
state = state || { last_login: null };
// Find the most recent login event
for (var i = 0; i < events.length; i++) {
var eventTime = new Date(events[i].time).getTime();
if (!state.last_login || eventTime > state.last_login) {
state.last_login = eventTime;
}
}
return state;
}); }```You'll need to replace "company_id" with the actual property name you use to identify companies in your events.
Exporting the Report
Once you've generated the report, you can export it in several ways: 1. UI Export: Click the "..." button in the top right corner of the report and select "Export" to download as CSV, PNG, or PDF.2. API Export: If you need to automate this process, you can use the Query API to export the formatted results.As mentioned in the Export Methods documentation, when exporting a CSV of a report in Table view, you can export up to 50,000 rows of data.Note that if you're on a Free plan, you can only export reports as CSV, PNG, or PDF from the UI, while Growth or Enterprise plans can also use the Query API.
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.
Let me check the knowledge base for you again. One moment! 📚
Yes, you can create a report of all your company IDs with their last login times using Mixpanel's Insights report with breakdowns instead of using JQL. This approach is more user-friendly and doesn't require coding.Here's how to do it: 1. First, ensure you have Group Analytics enabled (available as an add-on for Enterprise or Growth plans).2. Create an Insights report: - Go to the Insights report section - Select the "Login" event (or whatever your login event is named) - Change the measurement from the default to "Latest" (to get the most recent login time)3. Change the analysis level: - Click the "Analyze Uniques by" dropdown above the query builder - Select your company identifier (e.g., "company_id" or whatever you use)4. Add a breakdown: - Click the "Breakdown" button - Select your company ID property to break down results by each company5. Change the visualization: - In the top right, change the visualization to "Table" view to see all companies in a tabular formatThis will give you a table showing each company ID and their most recent login timestamp. As mentioned in the Insights documentation, Insights is a "powerful and flexible tool designed to visualize trends and compositions within your data" that allows you to analyze events at different levels, including the group level.You can then export this report by clicking the "..." button in the top right corner and selecting "Export" to download as CSV, PNG, or PDF. According to the Export Methods documentation, you can export up to 50,000 rows of data when exporting a CSV of an Insights report in Table view.
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.
Let me check the knowledge base for you again. One moment! 📚
I understand you're having trouble finding the "Latest" measurement option in Mixpanel Insights. Let me help you locate it.The measurement options are found in the lower section of your metric configuration. Here's how to access it: 1. In your Insights report, look for your event metric (the event you've selected) 2. At the bottom of the metric, you should see the current measurement (by default, it's usually "Unique Users") 3. Click on this measurement to open the measurement dropdown menu 4. Look for the "Advanced" section or click the "> " arrow to expand additional optionsBased on the documentation, you'll need to look in the "Aggregate Property" section of the measurements. The "Latest" option would be among the aggregation options that include: - Sum - Average - Median - Distinct Count - Percentiles (P25, P75, P90, P99) - Minimum - MaximumMeasurements documentation shows these options are available when you click into the advanced section of the measurement menu.If you're specifically looking to track the last login time, you might need to: 1. Select your login event 2. Change the measurement to "Aggregate Property" 3. Select a timestamp property associated with your login event 4. Then choose "Maximum" as the aggregation type (which would give you the latest timestamp)If you're still unable to find this option, it's possible that: 1. Your Mixpanel plan doesn't include this feature 2. The feature might be located differently in your version of Mixpanel 3. You might need to use a different approach to get the last login timeLet me know if you're able to find it or if you need additional guidance!
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.