[{"data":1,"prerenderedAt":507},["ShallowReactive",2],{"content-query-BdjisUiXf3":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"heading":10,"prompt":11,"tags":15,"files":17,"nav":17,"presets":18,"gallery":30,"body":32,"_type":500,"_id":501,"_source":502,"_file":503,"_stem":504,"_extension":505,"sitemap":506},"/tools/pivot-table","tools",false,"","Pivot Table Generator for Excel & CSV","Create pivot tables online from Excel and CSV data. Group, summarize, count, and aggregate rows with AI-generated analysis.","Pivot Table",{"prefix":12,"label":13,"placeholder":14},"Run pivot table","Describe the pivot table you want to create","e.g. pivot table to calculate sum of column A grouped by column B",[16],"statistics",true,[19,25],{"label":20,"prompt":21,"dataset_url":22,"dataset_title":23,"dataset_citation":24},"COVID deaths by age & sex","pivot table of total COVID-19 deaths by age group (rows) and sex (columns). Exclude rows where Age Group is 'All Ages' or Sex is 'All Sexes'","https://data.cdc.gov/api/views/9bhg-hcku/rows.csv?accessType=DOWNLOAD","Provisional COVID-19 Deaths by Sex and Age","CDC",{"label":26,"prompt":27,"dataset_url":28,"dataset_title":29,"dataset_citation":24},"Heart disease by state & year","pivot table of average heart disease mortality rate by State (rows) and Year (columns)","https://data.cdc.gov/api/views/55yu-xksw/rows.csv?accessType=DOWNLOAD","Heart Disease Mortality Data Among US Adults (35+) by State/Territory and County - 2019-2021",[31],"/img/tools/pivot-table.png",{"type":33,"children":34,"toc":492},"root",[35,44,58,63,88,94,134,140,264,270,395,401,418,435,459,475],{"type":36,"tag":37,"props":38,"children":40},"element","h2",{"id":39},"what-is-a-pivot-table",[41],{"type":42,"value":43},"text","What Is a Pivot Table?",{"type":36,"tag":45,"props":46,"children":47},"p",{},[48,50,56],{"type":42,"value":49},"A pivot table summarizes a large dataset by ",{"type":36,"tag":51,"props":52,"children":53},"strong",{},[54],{"type":42,"value":55},"grouping rows by one or more categories and aggregating a numeric column",{"type":42,"value":57}," — summing, counting, averaging, or finding min/max values. It is one of the most powerful data analysis tools for quickly extracting insights from raw data.",{"type":36,"tag":45,"props":59,"children":60},{},[61],{"type":42,"value":62},"Use a pivot table when you want to:",{"type":36,"tag":64,"props":65,"children":66},"ul",{},[67,73,78,83],{"type":36,"tag":68,"props":69,"children":70},"li",{},[71],{"type":42,"value":72},"Sum sales by region and product category",{"type":36,"tag":68,"props":74,"children":75},{},[76],{"type":42,"value":77},"Count the number of orders per customer per month",{"type":36,"tag":68,"props":79,"children":80},{},[81],{"type":42,"value":82},"Calculate the average score by department and year",{"type":36,"tag":68,"props":84,"children":85},{},[86],{"type":42,"value":87},"Find the maximum or minimum value within each group",{"type":36,"tag":37,"props":89,"children":91},{"id":90},"how-it-works",[92],{"type":42,"value":93},"How It Works",{"type":36,"tag":95,"props":96,"children":97},"ol",{},[98,108,124],{"type":36,"tag":68,"props":99,"children":100},{},[101,106],{"type":36,"tag":51,"props":102,"children":103},{},[104],{"type":42,"value":105},"Upload your data",{"type":42,"value":107}," — CSV or Excel file",{"type":36,"tag":68,"props":109,"children":110},{},[111,116,118],{"type":36,"tag":51,"props":112,"children":113},{},[114],{"type":42,"value":115},"Describe the table",{"type":42,"value":117}," — e.g. ",{"type":36,"tag":119,"props":120,"children":121},"em",{},[122],{"type":42,"value":123},"\"pivot table showing total revenue by region and product category\"",{"type":36,"tag":68,"props":125,"children":126},{},[127,132],{"type":36,"tag":51,"props":128,"children":129},{},[130],{"type":42,"value":131},"Get a formatted table",{"type":42,"value":133}," — rows are the grouping categories, columns are the aggregated values",{"type":36,"tag":37,"props":135,"children":137},{"id":136},"common-aggregations",[138],{"type":42,"value":139},"Common Aggregations",{"type":36,"tag":141,"props":142,"children":143},"table",{},[144,163],{"type":36,"tag":145,"props":146,"children":147},"thead",{},[148],{"type":36,"tag":149,"props":150,"children":151},"tr",{},[152,158],{"type":36,"tag":153,"props":154,"children":155},"th",{},[156],{"type":42,"value":157},"Aggregation",{"type":36,"tag":153,"props":159,"children":160},{},[161],{"type":42,"value":162},"What it computes",{"type":36,"tag":164,"props":165,"children":166},"tbody",{},[167,184,200,216,232,248],{"type":36,"tag":149,"props":168,"children":169},{},[170,179],{"type":36,"tag":171,"props":172,"children":173},"td",{},[174],{"type":36,"tag":51,"props":175,"children":176},{},[177],{"type":42,"value":178},"Sum",{"type":36,"tag":171,"props":180,"children":181},{},[182],{"type":42,"value":183},"Total of numeric values in each group",{"type":36,"tag":149,"props":185,"children":186},{},[187,195],{"type":36,"tag":171,"props":188,"children":189},{},[190],{"type":36,"tag":51,"props":191,"children":192},{},[193],{"type":42,"value":194},"Count",{"type":36,"tag":171,"props":196,"children":197},{},[198],{"type":42,"value":199},"Number of rows in each group",{"type":36,"tag":149,"props":201,"children":202},{},[203,211],{"type":36,"tag":171,"props":204,"children":205},{},[206],{"type":36,"tag":51,"props":207,"children":208},{},[209],{"type":42,"value":210},"Mean / Average",{"type":36,"tag":171,"props":212,"children":213},{},[214],{"type":42,"value":215},"Average value in each group",{"type":36,"tag":149,"props":217,"children":218},{},[219,227],{"type":36,"tag":171,"props":220,"children":221},{},[222],{"type":36,"tag":51,"props":223,"children":224},{},[225],{"type":42,"value":226},"Min / Max",{"type":36,"tag":171,"props":228,"children":229},{},[230],{"type":42,"value":231},"Smallest or largest value in each group",{"type":36,"tag":149,"props":233,"children":234},{},[235,243],{"type":36,"tag":171,"props":236,"children":237},{},[238],{"type":36,"tag":51,"props":239,"children":240},{},[241],{"type":42,"value":242},"Median",{"type":36,"tag":171,"props":244,"children":245},{},[246],{"type":42,"value":247},"Middle value in each group",{"type":36,"tag":149,"props":249,"children":250},{},[251,259],{"type":36,"tag":171,"props":252,"children":253},{},[254],{"type":36,"tag":51,"props":255,"children":256},{},[257],{"type":42,"value":258},"% of total",{"type":36,"tag":171,"props":260,"children":261},{},[262],{"type":42,"value":263},"Each group's share of the grand total",{"type":36,"tag":37,"props":265,"children":267},{"id":266},"example-prompts",[268],{"type":42,"value":269},"Example Prompts",{"type":36,"tag":141,"props":271,"children":272},{},[273,289],{"type":36,"tag":145,"props":274,"children":275},{},[276],{"type":36,"tag":149,"props":277,"children":278},{},[279,284],{"type":36,"tag":153,"props":280,"children":281},{},[282],{"type":42,"value":283},"What you want",{"type":36,"tag":153,"props":285,"children":286},{},[287],{"type":42,"value":288},"What to type",{"type":36,"tag":164,"props":290,"children":291},{},[292,310,327,344,361,378],{"type":36,"tag":149,"props":293,"children":294},{},[295,300],{"type":36,"tag":171,"props":296,"children":297},{},[298],{"type":42,"value":299},"Sales by region",{"type":36,"tag":171,"props":301,"children":302},{},[303],{"type":36,"tag":304,"props":305,"children":307},"code",{"className":306},[],[308],{"type":42,"value":309},"pivot table: sum of revenue grouped by region",{"type":36,"tag":149,"props":311,"children":312},{},[313,318],{"type":36,"tag":171,"props":314,"children":315},{},[316],{"type":42,"value":317},"Two-level grouping",{"type":36,"tag":171,"props":319,"children":320},{},[321],{"type":36,"tag":304,"props":322,"children":324},{"className":323},[],[325],{"type":42,"value":326},"pivot table of total sales by region and product_category",{"type":36,"tag":149,"props":328,"children":329},{},[330,335],{"type":36,"tag":171,"props":331,"children":332},{},[333],{"type":42,"value":334},"Count instead of sum",{"type":36,"tag":171,"props":336,"children":337},{},[338],{"type":36,"tag":304,"props":339,"children":341},{"className":340},[],[342],{"type":42,"value":343},"count of orders by customer_id and month",{"type":36,"tag":149,"props":345,"children":346},{},[347,352],{"type":36,"tag":171,"props":348,"children":349},{},[350],{"type":42,"value":351},"Average salary",{"type":36,"tag":171,"props":353,"children":354},{},[355],{"type":36,"tag":304,"props":356,"children":358},{"className":357},[],[359],{"type":42,"value":360},"average salary by department and job_level",{"type":36,"tag":149,"props":362,"children":363},{},[364,369],{"type":36,"tag":171,"props":365,"children":366},{},[367],{"type":42,"value":368},"Multiple aggregations",{"type":36,"tag":171,"props":370,"children":371},{},[372],{"type":36,"tag":304,"props":373,"children":375},{"className":374},[],[376],{"type":42,"value":377},"pivot table showing sum and count of revenue by region",{"type":36,"tag":149,"props":379,"children":380},{},[381,386],{"type":36,"tag":171,"props":382,"children":383},{},[384],{"type":42,"value":385},"Percentage of total",{"type":36,"tag":171,"props":387,"children":388},{},[389],{"type":36,"tag":304,"props":390,"children":392},{"className":391},[],[393],{"type":42,"value":394},"pivot table of revenue by category as percentage of total",{"type":36,"tag":37,"props":396,"children":398},{"id":397},"frequently-asked-questions",[399],{"type":42,"value":400},"Frequently Asked Questions",{"type":36,"tag":45,"props":402,"children":403},{},[404,409,411,416],{"type":36,"tag":51,"props":405,"children":406},{},[407],{"type":42,"value":408},"Can I group by multiple columns at once?",{"type":42,"value":410},"\nYes — ask for ",{"type":36,"tag":119,"props":412,"children":413},{},[414],{"type":42,"value":415},"\"pivot table of revenue by region and product category\"",{"type":42,"value":417}," and the AI will create a multi-level grouped table.",{"type":36,"tag":45,"props":419,"children":420},{},[421,426,428,433],{"type":36,"tag":51,"props":422,"children":423},{},[424],{"type":42,"value":425},"Can I pivot wide instead of long?",{"type":42,"value":427},"\nYes — ask to ",{"type":36,"tag":119,"props":429,"children":430},{},[431],{"type":42,"value":432},"\"pivot so each product category becomes its own column\"",{"type":42,"value":434}," for a cross-tab layout (rows = regions, columns = categories, values = revenue).",{"type":36,"tag":45,"props":436,"children":437},{},[438,443,445,450,452,457],{"type":36,"tag":51,"props":439,"children":440},{},[441],{"type":42,"value":442},"How do I sort the results?",{"type":42,"value":444},"\nAsk to ",{"type":36,"tag":119,"props":446,"children":447},{},[448],{"type":42,"value":449},"\"sort by total revenue descending\"",{"type":42,"value":451}," or ",{"type":36,"tag":119,"props":453,"children":454},{},[455],{"type":42,"value":456},"\"sort alphabetically by region\"",{"type":42,"value":458},".",{"type":36,"tag":45,"props":460,"children":461},{},[462,467,469,474],{"type":36,"tag":51,"props":463,"children":464},{},[465],{"type":42,"value":466},"Can I filter to only certain rows before pivoting?",{"type":42,"value":468},"\nYes — describe the filter in your prompt: ",{"type":36,"tag":119,"props":470,"children":471},{},[472],{"type":42,"value":473},"\"pivot table of revenue by region, only for orders in 2024\"",{"type":42,"value":458},{"type":36,"tag":45,"props":476,"children":477},{},[478,483,485,490],{"type":36,"tag":51,"props":479,"children":480},{},[481],{"type":42,"value":482},"What if I want to visualize the pivot table as a chart?",{"type":42,"value":484},"\nAfter generating the pivot table, ask the AI to ",{"type":36,"tag":119,"props":486,"children":487},{},[488],{"type":42,"value":489},"\"visualize this as a grouped bar chart\"",{"type":42,"value":491}," in the same chat session.",{"title":7,"searchDepth":493,"depth":493,"links":494},2,[495,496,497,498,499],{"id":39,"depth":493,"text":43},{"id":90,"depth":493,"text":93},{"id":136,"depth":493,"text":139},{"id":266,"depth":493,"text":269},{"id":397,"depth":493,"text":400},"markdown","content:tools:0010.pivot-table.md","content","tools/0010.pivot-table.md","tools/0010.pivot-table","md",{"loc":4},1775502468196]