100% found this document useful (1 vote)
49 views

Modern Data Analytics In Excel Using Power Query Power Pivot And More For Enhanced Data Analytics 1st Converted George Mount download

The document is a promotional overview of the book 'Modern Data Analytics in Excel' by George Mount, which focuses on using Excel's modern features like Power Query and Power Pivot for enhanced data analytics. It outlines the book's structure, learning objectives, and prerequisites for readers, emphasizing the transformation of Excel into a powerful analytics tool. Additionally, it provides links to various related resources and products available for download.

Uploaded by

genchindamen75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
49 views

Modern Data Analytics In Excel Using Power Query Power Pivot And More For Enhanced Data Analytics 1st Converted George Mount download

The document is a promotional overview of the book 'Modern Data Analytics in Excel' by George Mount, which focuses on using Excel's modern features like Power Query and Power Pivot for enhanced data analytics. It outlines the book's structure, learning objectives, and prerequisites for readers, emphasizing the transformation of Excel into a powerful analytics tool. Additionally, it provides links to various related resources and products available for download.

Uploaded by

genchindamen75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Modern Data Analytics In Excel Using Power Query

Power Pivot And More For Enhanced Data Analytics


1st Converted George Mount download

https://ebookbell.com/product/modern-data-analytics-in-excel-
using-power-query-power-pivot-and-more-for-enhanced-data-
analytics-1st-converted-george-mount-57044528

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Modern Data Analytics In Excel Using Power Query Power Pivot And More
For Enhanced Data Analytics George Mount

https://ebookbell.com/product/modern-data-analytics-in-excel-using-
power-query-power-pivot-and-more-for-enhanced-data-analytics-george-
mount-56323326

Modern Data Analytics In Excel Using Power Query Power Pivot And More
For Enhanced Data Analytics George Mount

https://ebookbell.com/product/modern-data-analytics-in-excel-using-
power-query-power-pivot-and-more-for-enhanced-data-analytics-george-
mount-57030118

Modern Data Analytics In Excel Second Early Release George Mount

https://ebookbell.com/product/modern-data-analytics-in-excel-second-
early-release-george-mount-53072462

Modern Data Analytics In Excel Early George Mount

https://ebookbell.com/product/modern-data-analytics-in-excel-early-
george-mount-51196912
Modern Data Analytics In Excel George Mount

https://ebookbell.com/product/modern-data-analytics-in-excel-george-
mount-57015604

Modern Data Analytics In Excel George Mount

https://ebookbell.com/product/modern-data-analytics-in-excel-george-
mount-57056726

Data Lakehouse In Action Architecting A Modern And Scalable Data


Analytics Platform Pradeep Menon

https://ebookbell.com/product/data-lakehouse-in-action-architecting-a-
modern-and-scalable-data-analytics-platform-pradeep-menon-47995190

Data Management On New Hardware 7th International Workshop On


Accelerating Data Analysis And Data Management Systems Using Modern
Processor And Storage Architectures Adms 2016 And 4th International
Workshop On Inmemory Data Management And Analytics Im 1st Edition
Spyros Blanas
https://ebookbell.com/product/data-management-on-new-hardware-7th-
international-workshop-on-accelerating-data-analysis-and-data-
management-systems-using-modern-processor-and-storage-architectures-
adms-2016-and-4th-international-workshop-on-inmemory-data-management-
and-analytics-im-1st-edition-spyros-blanas-5883876

Modern Analysis Of Biological Data Generalized Linear Models In R


Stano Pekar

https://ebookbell.com/product/modern-analysis-of-biological-data-
generalized-linear-models-in-r-stano-pekar-7043338
Modern Data Analytics in
Excel
Using Power Query, Power Pivot, and
More for Enhanced Data Analytics

George Mount
Modern Data Analytics in Excel
by George Mount
Copyright © 2024 Candid World Consulting, LLC. All rights
reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein
Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business,
or sales promotional use. Online editions are also available
for most titles (http://oreilly.com). For more information,
contact our corporate/institutional sales department: 800-
998-9938 or [email protected].

Acquisitions Editor: Michelle Smith

Development Editor: Sara Hunter

Production Editor: Christopher Faucher

Copyeditor: Penelope Perkins

Proofreader: Helena Stirling

Indexer: BIM Creatives, LLC

Interior Designer: David Futato

Cover Designer: Karen Montgomery

Illustrator: Kate Dullea

May 2024: First Edition

Revision History for the First Edition


2024-04-26: First Release
See http://oreilly.com/catalog/errata.csp?
isbn=9781098148829 for release details.
The O’Reilly logo is a registered trademark of O’Reilly
Media, Inc. Modern Data Analytics in Excel, the cover
image, and related trade dress are trademarks of O’Reilly
Media, Inc.
The views expressed in this work are those of the author
and do not represent the publisher’s views. While the
publisher and the author have used good faith efforts to
ensure that the information and instructions contained in
this work are accurate, the publisher and the author
disclaim all responsibility for errors or omissions, including
without limitation responsibility for damages resulting from
the use of or reliance on this work. Use of the information
and instructions contained in this work is at your own risk.
If any code samples or other technology this work contains
or describes is subject to open source licenses or the
intellectual property rights of others, it is your
responsibility to ensure that your use thereof complies with
such licenses and/or rights.
978-1-098-14882-9
[LSI]
Preface

Welcome to the Excel revolution. By updating how you


think about and use Excel, you can unlock significant
productivity gains and use your data more powerfully. This
book introduces the “modern Excel” suite of features and
other powerful analytics tools.

Learning Objective
By the end of this book, you should be able to use modern
Excel tools for data cleaning, analysis, reporting, and
advanced analytics. In particular, you’ll clean and
transform data with Power Query, create relational models
in Power Pivot to build sophisticated analyses, and explore
the Excel analytics toolkit to further automate and enhance
your work.

Prerequisites
To meet these objectives, this book makes some technical
and technological assumptions.

Technical Requirements
To make the most of this book, it is recommended that you
have a Windows computer with the Microsoft 365 version
of Excel for desktop. The features covered in this book are
relatively new and may not be available in older Excel
versions. Please note that many of these tools are still
being developed for Mac, and compatibility may vary. Due
to the fast-paced nature of Excel’s development, it is
difficult to provide a precise list of what’s available for each
version.
Chapter 7 of the book briefly explains how to load a Data
Model from Excel into Power BI. It assumes that, as a
Microsoft 365 for Windows user, you already have the free
version of Power BI Desktop installed on your computer.
Chapter 12 delves into the integration of Python with Excel,
guiding you through the process of downloading Python for
free. All subsequent tasks and exercises within the book
are designed to be completed exclusively within Excel,
eliminating the need for external programs. However, you
will configure a few Excel add-ins as part of the process.

Technological Requirements
This book is designed for intermediate Excel users eager to
discover modern features with which they might not be
familiar. To fully benefit from it, you should already be
acquainted with the following Excel topics:
Working with absolute-, relative-, and mixed-cell
references
Building conditional logic and conditional aggregation
functions (IF() statements, SUMIF()/SUMIFS(), and so
forth)

Combining data sources (VLOOKUP(), INDEX()/MATCH(), or


other lookup functions)
Sorting, filtering, and aggregating data with
PivotTables
Basic plotting (bar charts, line charts, and so forth)
If you would like more practice with these topics before
continuing, I recommend Microsoft Excel 365 Bible by
Michael Alexander and Dick Kusleika (Wiley, 2022).
In Part III of the book, you will explore advanced concepts
in statistics, programming, and related areas. Don’t be
discouraged if these topics appear challenging at first.
There are ample resources to assist you in gaining
proficiency, and I will provide helpful references when
necessary. The primary objective of this book is to
demonstrate the vast possibilities that Excel offers.
If you prefer to enhance your knowledge first before
delving into these topics, I recommend reading my book
Advancing into Analytics: From Excel to Python and R
(O’Reilly, 2021). It offers comprehensive insights and
guidance on advanced analytics techniques, Python
programming, and various other topics relevant to modern
data analytics in Excel.

How I Got Here


My journey to the data world started with Excel during the
early 2010s, before data science and AI had fully taken the
world by storm. At that time, Excel often felt like a closed
system. If you desired to perform advanced analytics, it was
commonly advised to switch to Python or R. For self-service
relational data models, Access was recommended. Many of
the complex analyses and automations I aimed to
accomplish involved cumbersome VBA modules and
unwieldy array formulas, making the user experience less
than ideal.
For a while, it appeared that Excel might eventually
succumb to obsolescence. However, today’s Excel,
bolstered by various features and applications, has
undergone a remarkable transformation.

What Is “Modern Analytics”? Why


Excel?
Modern analytics refers to the use of advanced tools and
techniques to prepare and analyze data, ranging from
simple retrospective analyses to predictive modeling and
artificial intelligence. In the evolving landscape of data-
driven decision making, it’s essential to have tools that are
versatile and interoperable, enabling users to perform a
wide range of analytics activities.
Previously, Excel fell short in meeting these requirements.
However, Excel has undergone significant transformation
over the past decade, making it a true powerhouse for
modern data analytics.
This book aims to dispel common misconceptions held by
technical professionals about Excel and to demonstrate its
capabilities in the modern analytics realm. By showcasing
features such as Power Pivot, Power Query, and other
tools, this book challenges the belief that Excel is limited to
basic formulas and functions. It emphasizes that today’s
Excel has evolved into a robust platform capable of
handling complex data analytics tasks.
Ultimately, this book showcases Excel as a powerful and
versatile tool for modern analytics. It seeks to debunk
myths, guiding technical professionals and managers to
fully exploit Excel’s potential for effective data analysis and
decision making. In doing so, it enables users to harness
Excel as a crucial component of the contemporary analytics
toolkit, providing insights and driving success in our data-
driven world.

MODERN EXCEL AND INTEROPERABILITY


Modern analytics emphasizes interoperability, so it’s not
surprising that many tools showcased in this book are
also prevalent elsewhere in the analyst’s toolkit.
Notably, Power Query and Power Pivot, discussed in
Part I and Part II respectively, are also available in
Power BI, Microsoft’s business intelligence and
reporting tool. Python can also be utilized in Power BI.
These tools can be combined in various ways, and as you
master one, you’re likely to encounter it in a different
context. This book primarily focuses on Excel, but it’s
helpful to understand how these elements fit into the
broader modern analytics toolkit.
Book Overview
To meet the learning objective and scope of this book, I’ve
divided the content into three parts.
Part I, Data Cleaning and Transformation with
Power Query
Part I focuses on Power Query for data cleaning in Excel,
and how it can be used as an extract, transform, load (ETL)
tool. You’ll get a tour of the Power Query Editor, learning
about data profiling and various transformation techniques
such as filtering, splitting, aggregating, and merging data.
Part II, Data Modeling and Analysis with Power
Pivot
Part II introduces Power Pivot for Excel, focusing on its use
for reporting. You will learn how to define relationships,
build a Data Model, and enhance it with calculated
columns, key performance indicators (KPIs), and more—
primarily using the Data Analysis Expressions (DAX)
language.
Part III, The Excel Data Analytics Toolkit
Part III of the book explores several exciting new features
for data analysis in Excel. You will learn about dynamic
array functions, which enable quick and flexible
spreadsheet calculations. Additionally, the book provides a
primer on predictive analytics and AI, discussing their
potential applications in Excel and offering a glimpse into
the program’s future. The book concludes with an
advanced topic: building an automated workbook using
Python. You will learn how to effectively leverage Python
and Excel together to enhance your analytical capabilities.
End-of-Chapter Exercises
When I read books, I tend to skip over the exercises at the
end of the chapter because I feel keeping the momentum of
my reading is more valuable. Don’t be like me!
At the end of most chapters, I offer opportunities to apply
what you’ve learned through practice. Exercises and their
solutions are located in the exercises folder within the
accompanying repository, organized into subfolders by
chapter number. I encourage you to complete these drills
and then compare your responses with the provided
solutions. By doing so, you will not only enhance your
understanding of the material, but also set a positive
example for me.

This Is Not a Laundry List


Excel’s rapid development pace and the abundance of new
tools can be overwhelming. To avoid losing focus and
making the book unwieldy, I have carefully selected a
specific set of topics with broad potential and usefulness
for intermediate Excel users, drawing from my years of
experience as an Excel consultant and trainer.
If your favorite or most impactful feature for modern
analytics in Excel is not covered in this book, I encourage
you to share your perspective as a valued member of the
community. The realm of data analytics in Excel goes
beyond the boundaries of a single book, and the Excel
community is eager to learn from your insights and
experiences.
Are you ready to embark on a tour of modern Excel? I’ll
meet you in Chapter 1.
Conventions Used in This Book
The following typographical conventions are used in this
book:
Italic
Indicates new terms, URLs, email addresses, filenames, and
file extensions.

Constant width
Used for program listings, as well as within paragraphs to
refer to program elements such as variable or function
names, databases, data types, environment variables,
statements, and keywords.

Constant width bold


Shows commands or other text that should be typed literally
by the user.

Constant width italic


Shows text that should be replaced with user-supplied
values or by values determined by context.

TIP
This element signifies a tip or suggestion.

NOTE
This element signifies a general note.
WARNING
This element indicates a warning or caution.

Using Code Examples


Supplemental material (code examples, exercises, etc.) is
available for download at
https://github.com/stringfestdata/modern-analytics-excel-
book.
This book is here to help you get your job done. In general,
if example code is offered with this book, you may use it in
your programs and documentation. You do not need to
contact us for permission unless you’re reproducing a
significant portion of the code. For example, writing a
program that uses several chunks of code from this book
does not require permission. Selling or distributing
examples from O’Reilly books does require permission.
Answering a question by citing this book and quoting
example code does not require permission. Incorporating a
significant amount of example code from this book into
your product’s documentation does require permission.
We appreciate, but generally do not require, attribution. An
attribution usually includes the title, author, publisher, and
ISBN. For example: “Modern Data Analytics in Excel by
George Mount (O’Reilly). Copyright 2024 Candid World
Consulting, LLC, 978-1-098-14882-9.”
If you feel your use of code examples falls outside fair use
or the permission given above, feel free to contact us at
[email protected].
O’Reilly Online Learning

NOTE
For more than 40 years, O’Reilly Media has provided technology and
business training, knowledge, and insight to help companies succeed.

Our unique network of experts and innovators share their


knowledge and expertise through books, articles, and our
online learning platform. O’Reilly’s online learning platform
gives you on-demand access to live training courses, in-
depth learning paths, interactive coding environments, and
a vast collection of text and video from O’Reilly and 200+
other publishers. For more information, visit
https://oreilly.com.

How to Contact Us
Please address comments and questions concerning this
book to the publisher:

O’Reilly Media, Inc.

1005 Gravenstein Highway North

Sebastopol, CA 95472

800-889-8969 (in the United States or Canada)

707-827-7019 (international or local)

707-829-0104 (fax)
[email protected]

https://www.oreilly.com/about/contact.html

We have a web page for this book, where we list errata,


examples, and any additional information. You can access
this page at https://oreil.ly/modern-data-analytics-excel.
For news and information about our books and courses,
visit https://oreilly.com.
Find us on LinkedIn: https://linkedin.com/company/oreilly-
media.
Watch us on YouTube: https://youtube.com/oreillymedia.

Acknowledgments
One of the most fascinating aspects of writing a book,
especially the acknowledgments, is that it captures a
moment in your life and highlights the people who are
significant at that time.
Many of these names can be found in the acknowledgments
to my previous book. I am especially grateful to the
acquisitions team at O’Reilly, Michelle Smith and Jon
Hassell, for giving me the green light to write another
book. My friend and fellow O’Reilly author, Tobias
Zwingmann, whose work I have mutually reviewed over the
years, provided an exceptionally helpful technical review
for this project. Additionally, my parents, Jonathan and
Angela Mount, have been unwavering in their support,
more than I could ever ask for. It’s uncertain how many
mothers wish their children to become Excel authors, but
mine has been incredibly supportive.
I also had the opportunity to deepen my acquaintance with
some individuals through this project. I extend my thanks
to Alan Murray, Joseph Stec, and Meghan Finley for their
invaluable additional technical reviews. Meghan, in
particular, has not only brought her impressive technical
editing experience to the book but has also been an
incredible support as my girlfriend throughout the writing
process. (As any author will tell you, writing a book
inevitably becomes a family affair.) Additionally, I am
grateful to Jeff Stevens, Laura Szepesi, and Mark Depow
for their feedback on the manuscript.
Moreover, I owe a debt of gratitude to the editorial team at
O’Reilly, who guided me through the extensive process of
writing a technical book. A special thanks to Sara Hunter
for being an invaluable editorial sounding board as I
embarked on writing my second book.
Lastly, I would like to express my appreciation to the entire
Excel community for being such a welcoming and inspiring
group. This spreadsheet program has opened up more
opportunities and introduced me to more incredible people
than I could have ever imagined. I hope this book
contributes in some small way to your own remarkable
journey with Excel.
Part I. Data Cleaning and
Transformation with Power
Query
Chapter 1. Tables: The
Portal to Modern Excel

Excel boasts an extensive array of analytical tools, which


can make it challenging to determine the best starting
point. However, a fundamental step is mastering the Excel
table. This chapter delves into the essential elements of
Excel tables, acting as a conduit to Power Query, Power
Pivot, and additional tools highlighted in this book. It
further underscores the significance of organizing data
within a table meticulously. To engage with this chapter’s
content, navigate to ch_01.xlsx in the ch_01 folder located
within the companion repository of the book.

Creating and Referring to Table


Headers
A dataset without column headers is practically useless, as
it lacks meaningful context for interpreting what each
column measures. Unfortunately, it’s not uncommon to
encounter datasets that break this cardinal rule. Excel
tables act as a valuable reminder that the quality of a
dataset hinges on the presence of clear and informative
headers.
In the start worksheet of ch_01.xlsx, you will come across
data in columns A:F without corresponding headers, which
are currently located in columns H:M. This design is far less
than optimal. To adjust it, click anywhere within the
primary data source and proceed from the ribbon to Insert
→ Table → OK, as illustrated in Figure 1-1. Alternatively,
you can press Ctrl+T or Ctrl+L from within the data source
to launch the same Create Table dialog box.

Figure 1-1. Converting the data source into a table

The Create Table dialog box automatically prompts you to


specify if your data includes headers. Currently, it does not.
In the absence of headers, the dataset is automatically
assigned a series of header columns named Column1, Column2,
and so forth.
From here, you can cut and paste the headers from
columns H:M into the main table to clarify what is being
measured in each column, such as in Figure 1-2.
Figure 1-2. Excel table with headers

Header columns in Excel tables occupy a unique role in the


dataset. While part of the table, they function as metadata
rather than data itself. Excel tables provide the ability to
programmatically distinguish between headers and data,
unlike classic Excel formulas.
To see this difference in action, head to a blank cell in your
worksheet and enter the equals sign. Point to cells A1:F1 as
your reference, and you’ll notice that the formula becomes
Table1[#Headers].
You can also utilize this reference in other functions. For
example, you can use UPPER() to dynamically convert the
case of all the headers, such as in Figure 1-3.
Figure 1-3. Excel header reference formulas

Viewing the Table Footers


Just as every story has a beginning, middle, and end, every
Excel table comprises headers, data, and footers. However,
footers need to be manually enabled. To do this, click
anywhere in the table, navigate to Table Design on the
ribbon, and select Total Row in the Table Style Options
group, as in Figure 1-4.
Figure 1-4. Adding footers to a table

By default, the Total Row in a table will calculate the sum


of the last column in your data; in this case, frozen.
However, you can customize this by clicking the drop-down
menu on any column’s footer. For instance, you can find the
maximum sales amount of the fresh category, as in
Figure 1-5.
Figure 1-5. Customizing the footers of an Excel table

Table 1-1 summarizes the key formula references for the


major components of Excel tables, assuming the table is
named Table1.
Table 1-1. Summary of Excel table formula
references

Formula What it refers to

=Table1[#Headers] Table headers

=Table1 Table data

=Table1[#Totals] Table footers

=Table1[#All] Table headers, data, and footers

As you progress in your Excel table skills, you’ll discover


additional helpful formula references that rely on the
fundamental structure of headers, body, and footers.

Naming Excel Tables


Excel tables offer the advantage of enforcing the use of
named ranges, which promotes a more structured approach
to working with data. Although referring to Table1 is an
improvement over using cell coordinates like A1:F22, it is
better to choose a descriptive name that reflects what the
data represents.
To accomplish this, go to the Formulas tab on the ribbon,
select Name Manager in the Defined Names group, and
choose Edit for the Table1 name. Change the name to sales,
and then click OK. Figure 1-6 shows what your Name
Manager should look like after making this change.
Figure 1-6. Name Manager in Excel

Once you close the Name Manager, you’ll notice that all
references to Table1 have been automatically updated to
reflect the new name: sales.

Formatting Excel Tables


As an Excel user, you know the importance of presenting
data in an appealing format. Tables can be a game changer,
instantly enhancing the visual appeal of your worksheet.
With tables, you can easily add banded rows, colored
headers, and more. To customize the look and feel of your
table, click anywhere inside your table and head to Table
Design in the ribbon. Take a look at Figure 1-7 for various
options, such as changing table colors or toggling Banded
Rows on and off.
Figure 1-7. Table Design customization options

Updating Table Ranges


With Excel tables, the issue of totals becoming incorrect
when data is added or removed is effectively resolved.
Thanks to the use of structured references, formulas adapt
seamlessly to changes in the data, ensuring accuracy.
Furthermore, the total at the bottom of the table is
automatically updated to reflect these changes, and it can
be easily excluded from external references, maintaining
the integrity of your calculations.
Calculate the sum of the fresh column using the structured
formula =SUM(sales[fresh]). Microsoft’s IntelliSense
facilitates this process by allowing you to complete names
efficiently as you type. Experiment with adding or removing
rows, or modifying the fresh data in the sales table. You’ll
observe that the function to calculate total fresh sales
updates dynamically and maintains consistent accuracy.
Referring to data by name instead of cell location
minimizes potential formula issues arising from changing
the table’s size and placement. Tables also become crucial
in preventing problems like missing data in a PivotTable
when new rows are added.

Organizing Data for Analytics


While tables are valuable, an even more significant aspect
of ensuring effortless and accurate data analysis lies in
storing data in the appropriate shape.
Examine the sales table as an example. When attempting to
create a PivotTable to calculate total sales by region, the
format in which the data is stored presents a challenge.
Ideally, all sales information should be consolidated into a
single column. However, in the current setup, there is a
distinct sales column for each department: fresh, grocery,
and frozen. Excel does not recognize that these columns all
represent the same metric, namely sales.
The reason this and many other datasets get difficult to
analyze is that they are not stored in a format conducive to
analysis. The rules of tidy data offer a solution. While
Hadley Wickham offers three rules in his 2014 paper by the
same name, this book focuses on the first: each variable
forms a column.
The sales dataset violates the rule of tidy data by having
multiple entries for the same variable, field, across
different departments within each row. A helpful rule of
thumb is that if multiple columns are measuring the same
thing, the data is likely not tidy. By transforming the data
into a tidy format, analysis becomes significantly simpler.
In Figure 1-8, you can see a comparison of the dataset
before and after the transformation, highlighting the
improved tidiness and ease of analysis. In Chapter 4, you
will learn how to perform this fundamental transformation
on a dataset with just a few clicks. In the meantime, you
can explore the sales-tidy worksheet available in
ch01_solutions.xlsx, which has already been transformed.
Take a look to see firsthand how much simpler it is to
obtain total sales by region now.
Figure 1-8. Wholesale customers, before and after tidying

Conclusion
This chapter has laid the groundwork for utilizing Excel
tables effectively. For an in-depth exploration of
maximizing the potential of tables, including the
application of structured references to formulate calculated
columns, refer to Excel Tables: A Complete Guide for
Creating, Using, and Automating Lists and Tables by Zack
Barresse and Kevin Jones (Holy Macro! Books, 2014).
Additionally, this chapter delved into the meticulous
organization of data, a fundamental aspect of any
successful data analysis project in Excel. Chapter 2 offers
an introduction to simplifying data transformation with
Power Query.

Exercises
To create, analyze, and manipulate data in Excel tables,
follow the exercises using the penguins dataset located in
ch_01_exercises.xlsx in the exercises\ch_01_exercises
folder in the book’s companion repository:

1. Convert the data to a table named penguins.


2. Utilize a formula reference to capitalize each column
header.

3. Generate a new column called bill_ratio by dividing


bill_length_mm by bill_depth_mm.

4. Include a total row to calculate the average body_mass_g.


5. Remove the banded row styling from the table.

For the solutions, refer to the ch_01_exercise_solutions.xlsx


file located in the same folder.
Chapter 2. First Steps in
Excel Power Query

In Chapter 1, tables were introduced as the gateway to


modern Excel analytics. The following chapters of Part I
delve deeper into the modern Excel toolkit, particularly
Power Query. This tool addresses many of Excel’s
traditional limitations and offers a user-friendly, low-code
environment.

What Is Power Query?


Power Query is a data connection technology that enables
users to easily connect to, combine, and refine data from a
wide range of sources from within Excel. Initially
introduced as an add-in, it has become a core feature of
modern Excel, significantly simplifying the data import and
cleaning process. Power Query offers a user-friendly
interface for performing complex data manipulations, such
as merging tables, transforming data formats, and
aggregating information, without requiring advanced
programming skills.

Power Query as Excel Myth Buster


Analysts act as myth busters, challenging assumptions and
revealing truths. Even in the domain of Excel, a legendary
business tool, myths can arise. However, many of these
myths no longer hold true. Power Query has successfully
debunked numerous claims, positioning itself as the
ultimate myth buster for Excel. The next section will refute
common claims about Excel using Power Query.

“Excel Is Not Reproducible”


It’s a common scenario: you find yourself under pressure,
facing imminent deadlines and an intrusive manager, while
attempting to revise a report from the previous week. The
original creator of the report is unavailable, leaving you
perplexed about how it was assembled. The workbook
appears to be a jumbled mess of deleted columns and
altered values, making it difficult to decipher the necessary
actions to take.
Reproducibility in computation allows the user to
consistently achieve the same results by using identical
inputs and processes. A workbook falls short of this goal
when error-prone steps, complex calculations, or other
elements that introduce uncertainty render consistent
outcomes unattainable each time the file is opened.
The lack of reproducibility in traditional Excel has become
a significant point of criticism for the software. This
concern has led many technical professionals to be cautious
about using Excel altogether, fearing that a single deleted
column or a hard-coded cell could compromise the integrity
of their results.
The decision to completely abandon Excel based on its past
limitations is misguided. Excel now offers a solution for
reproducibility through Power Query. With Power Query,
users can create a duplicate of the source data, apply
consistent transformation steps, and document each action
in the Applied Steps list. This approach ensures
reproducibility and eliminates the need to track data
cleanup actions, addressing the concerns previously
associated with Excel’s lack of reproducibility.

VBA AND REPRODUCIBILITY


Experienced Excel users may question the assertion that
classic Excel lacks robust reproducibility features
because it includes Visual Basic for Applications (VBA).
While VBA does provide a comprehensive scripting
language that allows for auditing and debugging Excel
results, its steep learning curve has limited its usability
among most Excel users. Furthermore, Microsoft has
made minimal updates to VBA, instead introducing
alternative languages like Python, which will be
explored in Chapter 12.
Irrespective of the ongoing debates regarding the best
scripting language for Excel, ensuring a reproducible
workflow should not be restricted to those capable of
coding. It should be accessible to users with diverse
technical backgrounds, and this is precisely what Power
Query accomplishes.

“Excel Does Not Have a True null”


In relational databases, the concept of a missing or null
value, representing unknown or unspecified data, is well
known. However, Excel lacks a reserved keyword for null
values, resulting in storage and handling challenges. Users
may adopt different approaches for representing missing
values in Excel, such as leaving them blank or hard-coding
values like NA. This discrepancy makes it challenging to
identify genuinely unknown values versus those that are
actually equal to zero or intentionally left blank.
To overcome this limitation, Power Query introduces a
dedicated null value to represent missing data. This
enhancement facilitates precise profiling, removal, and
replacement of missing values, ensuring accuracy and
reproducibility.

“Excel Can’t Process More Than 1,048,576


Rows”
Another frequently used argument against Excel is its
perceived limitation when dealing with “big data.”
Detractors assert that with its worksheet maximum of
approximately one million rows, Excel falls short in the era
of massive datasets.
The solution lies, once again, in Power Query, which can
easily import and process millions of rows and more. While
it is true that Excel itself cannot handle more than a million
rows, Power Query empowers users to aggregate and
summarize the data within its editor before loading the
results into an Excel worksheet.
For a compelling demonstration of surpassing the alleged
million-row limit in Excel, check out this post from analytics
consultant Orlando Mézquita on analyzing fifty million rows
using Excel Power Query.

Power Query as Excel’s ETL Tool


In the world of tech, many terms may seem impossibly
complex at first glance. They may even be disguised by
confusing acronyms. Upon closer examination, however,
these concepts reveal their simplicity.
One such term is ETL, which stands for “extract, transform,
load.” Database administrators and data engineers often
passionately discuss their “ETL pipelines” and “ETL
software.” It may give the impression that only certified
data geeks can handle these tasks.
Power Query democratizes the ETL process by integrating
it directly into an Excel spreadsheet. Don’t let tech purists
intimidate you! The essence of ETL is inherent in its name
and can be accomplished using Excel.
The following sections present a step-by-step overview of
this process. To follow along, open ch_02.xlsx from the
book’s resources in the ch_02 folder.

Extract
The initial step in ETL is to “extract” the data from an
external source. Power Query has the ability to connect to a
diverse range of data sources, extending beyond Excel
workbooks. Here are some examples of the sources it can
connect to:

Text and CSV files


Relational databases like Oracle, Microsoft SQL Server,
or SQLite
SharePoint
XML, HTML, and web data

However, for this demonstration, the data is conveniently


located within the Excel workbook itself.
To begin, extract data from the sales table in the sales
worksheet of ch_02.xlsx. Click anywhere inside the table,
then go to Data → Get & Transform Data → From
Table/Range, as shown in Figure 2-1.
Figure 2-1. Extracting data from a table

The requirement of having this data in a table for utilizing


Power Query is in part why we dedicated Chapter 1 to
discussing tables. Tables serve as an essential gateway to
accessing modern Excel tools.
While it may seem odd to “connect to and extract” data that
already exists in your workbook, this approach is justified
by Power Query’s ability to preserve the raw data in its
original form. Even when the raw data is within the same
workbook as the analysis, it is advisable to extract a subset
of the data (the “E” in ETL) to proceed with any analysis.

Transform
The next step is to connect to this data and perform the
necessary transformations (the “T” in ETL).
Data transformation encompasses various tasks necessary
to render data usable, such as:

Sorting or filtering rows


Adding, dropping, renaming, or calculating columns
Merging or reshaping data sources

When you load your table into Power Query, the Power
Query Editor pops up, offering numerous options for data
cleaning and transformation. It can be quite overwhelming,
especially if you’re used to the classic Excel environment.
However, we’ll tackle this program step by step throughout
the rest of Part I.
You will learn how to perform several data cleaning tasks
later in the book. For now, a straightforward data
transformation can be achieved by adding an index column.
To do this, go to Add Column on the Power Query ribbon,
then Index Column → From 1, as shown in Figure 2-2.

Figure 2-2. Adding an index column from Power Query


Load
Finally, in the Power Query Editor, navigate to the Home
tab and choose Close & Load. This action will load the
slightly transformed data extract into another Excel table
and on a new worksheet, as seen in Figure 2-3.

Figure 2-3. Loading data from Power Query to an Excel table

Congratulations on completing an entire ETL job:


You extracted the raw data from an Excel table.
You transformed the data using the Power Query
Editor.
You loaded the results back into Excel.

A Tour of the Power Query Editor


Now that you’ve walked through a very simple example of
the entire Power Query ETL process, let’s take a closer look
at the Power Query Editor. For this demonstration, open
the penguins worksheet, also found in ch_02.xlsx.
To get started, load the penguins table into Power Query. If
you need a refresher on how to do this, you can refer back
to the previous section. The resulting Power Query Editor
should look like Figure 2-4.

Figure 2-4. The Power Query Editor

Take a moment to delve deeper and appreciate the


distinctive environment you’re in. It bears a resemblance to
Excel with its ribbon interface, yet it operates as an
independent, standalone program. The subsequent section
will explore its various elements.

The Ribbon Menu


At the top of the interface, you will notice a ribbon menu
closely modeled after Excel’s familiar interface, as shown in
Figure 2-5.

Figure 2-5. The Power Query ribbon

You should see four tabs on the ribbon: Home, Transform,


Add Column, and View:
Home
Just like with regular Excel, the Home tab consists of the
most fundamental operations in Power Query, such as
selecting rows, deleting columns, and more. However, the
Home tab in Power Query focuses on essential data
transformation and cleaning tasks, unlike regular Excel’s
formatting features.

Transform
The Transform tab offers additional options for data
cleaning and transformation. You’ll have the opportunity to
try many of these features in the following chapters.

Add Column
This tab is dedicated to creating new columns through a
variety of methods. In “Transform”, you used this tab to add
an index column to the data. In Chapter 4, you’ll use it to
create calculated columns.

View
The View tab customizes the display of the Power Query
Editor. To begin, click on Formula Bar in the Layout group.
This action will reveal a formula bar above your dataset,
similar to Excel, as shown in Figure 2-6.
Figure 2-6. The Power Query formula bar

The formula displayed in the Power Query formula bar may


appear different from typical Excel functions because it is
written in the M programming language, which is
specifically designed for Power Query. As you adjust your
query through the Power Query Editor’s point-and-click
interface, the underlying M code is altered accordingly.
This allows for debugging, customization, or sharing of
results.
Although the presence of the formula bar might imply that
mastering a complex programming language is crucial for
leveraging Power Query’s capabilities, this is not
necessarily true. The majority of everyday tasks can be
efficiently completed using the Home tab and other
features, bypassing the need for M coding. This book
focuses exclusively on these point-and-click options,
making the formula bar redundant for our purposes.

NOTE
This book won’t use the formula bar in the Power Query Editor for
future demonstrations. You can hide it by unchecking Formula Bar in
the Layout group on the View tab.

To explore writing your own M code in Power Query, start


by checking out the Advanced Editor. Access it by going to
the View tab in the Power Query Editor and clicking on
Advanced Editor in the Advanced group. This window
displays your entire query in a single, comprehensive view.
Queries
Shift your attention from the ribbon to the list of queries on
the upper left of the Editor. Here, you’ll find the imported
data sources, which you can toggle between to view. While
both sources reside within this workbook, keep in mind that
Power Query supports a wide range of data sources,
including .csv files, databases, web pages, and more.
To perform actions on a specific query, right-click on its
name, such as penguins, and a menu with various options
will appear, as shown in Figure 2-7. These options include
renaming the query, deleting it, and more.
Figure 2-7. List of queries in Power Query

Power Query offers a plethora of right-click options, so


don’t hesitate to explore and try them out.

The Imported Data


Now, shift your focus to the component occupying most of
the Editor’s space: the data itself. Unlike in Excel, where
you have the freedom to manipulate the data by, for
example, hiding columns or inserting formulas, Power
Query imposes editing restrictions.
To paraphrase lyrics of a song by The Police, Power Query
diligently observes and tracks every step and movement
you make with your query. Randomly hard-coding formulas
or hiding columns at will is not allowed. All actions must be
executed programmatically within Power Query’s
framework.
Consider the straightforward task of deleting a column. To
remove island from the penguins dataset, simply right-click
on the column label and choose “Remove,” as shown in
Figure 2-8.

Figure 2-8. Deleting a column in Power Query

The column has been permanently removed from the


dataset…​or has it? To understand how data changes work
in Power Query, take a look at the Applied Steps list to the
right of the data, as shown in Figure 2-9.
Figure 2-9. The Applied Steps list in Power Query

Power Query meticulously records every action, including


deletions, in the Applied Steps list, displayed alongside
your data. This ensures transparency and traceability of all
operations.
To be more precise, this deletion is documented as the
third step labeled Removed Columns in the Applied Steps
section. The initial step is connecting to the data, referred
to as the Source. The second step, Changed Type, involves
setting data types for the table. Unlike Excel, Power Query
requires every value within a column to be of the same
type. This book will largely rely on Power Query’s
automatic data type casting. You can learn more about
Power Query data types in Microsoft’s official
documentation.
By clicking on any of the steps in the Applied Steps list, you
can revisit the data as it appeared at that specific point in
time. For instance, if you click on Changed Type (the step
prior to the column removal), the island column will
reappear in your Editor view.
To reinforce your learning from earlier in this chapter, add
an index column starting at 1 to the dataset with the
Changed Type step still highlighted. You will receive a
message to confirm that you wish to insert an intermediate
step into the query, as in Figure 2-10.

Figure 2-10. Inserting an intermediate step into Power Query

After clicking Insert, you will notice that Added Index is


positioned before Removed Columns in the Applied Steps
list, even though it was added at a later point in time. This
allows for effortless modifications to the query as
requirements evolve or new steps are added to the
workflow.
You can perform various actions on these steps, such as
deleting or renaming them. Suppose you wish to
reintroduce the island column that was previously deleted
in the query. You have two options: either click the X icon
located to the left of the Removed Columns query step, or
right-click on that same step to access a menu that lets you
delete, rename, and reorder steps, among other tasks.

WARNING
Although the Applied Steps list offers flexibility, it lacks a cherished
feature of classic Excel: the ability to undo actions. Once a step is
deleted, there is no built-in option to undo the deletion. Because most
of these steps can be easily replicated, it is often just as convenient
to manually repeat the process instead of relying on an undo button.

Exiting the Power Query Editor


After creating the desired query in the editor, it’s time to
exit Power Query and return to the regular Excel
workbook. Earlier in this chapter, you saw that clicking
directly on Close & Load on the Home tab of the Power
Query Editor loads the result of the query to an Excel table.
There are other load options, which you can view by
clicking the drop-down button next to Close & Load, then
selecting Close & Load To. You should now see the dialog
in Figure 2-11.
Figure 2-11. Power Query loading options

Your first decision is whether to load the data into a table,


a PivotTable (referred to here as a PivotTable Report), a
PivotChart, or to choose the connection-only option. When
loading to connection only, the results of your query will
not be loaded into Excel, but the query itself will remain
accessible in the Power Query Editor.
Random documents with unrelated
content Scribd suggests to you:
movement, which now proceeded with redoubled enthusiasm. Both
Mantinea and Tegea were cordially united in its favor; though
Orchomenus, still strenuous in opposing it, hired for that purpose, as
well as for her own defence, a body of mercenaries from Corinth
under Polytropus. A full assembly of the Arcadian name was
convoked at a small town called Asea, in the mountainous district
west of Tegea. It appears to have been numerously attended; for we
hear of one place, Eutæa (in the district of Mount Mænalus,[446] and
near the borders of Laconia), from whence every single male adult
went to the assembly. It was here that the consummation of the
Pan-Arcadian confederacy was finally determined; though
Orchomenus and Heræa still stood aloof.[447]
There could hardly be a more fatal blow to Sparta than this loss
to herself, and transfer to her enemies, of Tegea, the most powerful
of her remaining allies.[448] To assist the exiles and avenge
Stasippus, as well as to arrest the Arcadian movement, she resolved
on a march into the country, in spite of her present dispirited
condition; while Heræa and Lepreum, but no other places, sent
contingents to her aid. From Elis and Argos, on the other hand,
reinforcements came to Mantinea and Tegea. Proclaiming that the
Mantineans had violated the recent peace by their entry into Tegea,
Agesilaus marched across the border against them. The first
Arcadian town which he reached was Eutæa,[449] where he found
that all the male adults had gone to the great Arcadian assembly.
Though the feebler population, remaining behind, were completely
in his power, he took scrupulous care to respect both person and
property, and even lent aid to rebuild a decayed portion of the wall.
At Eutæa he halted a day or two, thinking it prudent to wait for the
junction of the mercenary force and the Bœotian exiles under
Polytropus, now at Orchomenus. Against the latter place, however,
the Mantineans had marched under Lykomêdes, while Polytropus,
coming forth from the walls to meet them, had been defeated with
loss, and slain.[450] Hence Agesilaus was compelled to advance
onward with his own unassisted forces, through the territory of
Tegea up to the neighborhood of Mantinea. His onward march left
the way from Asea to Tegea free, upon which the Arcadians
assembled at Asea broke up, and marched by night to Tegea; from
whence, on the next day, they proceeded to Mantinea, along the
mountain range eastward of the Tegeatic plain; so that the whole
Arcadian force thus became united. Agesilaus on his side, having
ravaged the fields and encamped within little more than two miles
from the walls of Mantinea, was agreeably surprised by the junction
of his allies from Orchomenus, who had eluded by a night-march the
vigilance of the enemy. Both on one side and on the other, the forces
were thus concentrated. Agesilaus found himself on the first night,
without intending it, embosomed in a recess of the mountains near
Mantinea, where the Mantineans gathered on the high ground
around, in order to attack him from above, the next morning. By a
well-managed retreat, he extricated himself from this inconvenient
position, and regained the plain; where he remained three days,
prepared to give battle if the enemy came forth, in order that he
might “not seem (says Xenophon) to hasten his departure through
fear.”[451] As the enemy kept within their walls, he marched
homeward, on the fourth day, to his former camp in the Tegean
territory. The enemy did not pursue, and he then pushed on his
march, though it was late in the evening, to Eutæa; “wishing (says
Xenophon) to get his troops off before even the enemies’ fires could
be seen, in order that no one might say that his return was a flight.
He thought that he had raised the spirit of Sparta out of the previous
discouragement, by invading Arcadia and ravaging the country
without any enemy coming forth to fight him.”[452] The army was
then brought back to Sparta and disbanded.
It had now become a matter of boast for Agesilaus (according to
his own friendly historian) to keep the field for three or four days,
without showing fear of Arcadians and Eleians! So fatally had
Spartan pride broken down, since the day (less than eighteen
months before) when the peremptory order had been sent to
Kleombrotus, to march out of Phokis straight against Thebes!
Nevertheless it was not from fear of Agesilaus, but from a wise
discretion, that the Arcadians and Eleians had kept within the walls
of Mantinea. Epaminondas with the Theban army was approaching
to their aid, and daily expected; a sum of ten talents having been
lent by the Eleians to defray the cost.[453] He had been invited by
them and by others of the smaller Peloponnesian states, who felt the
necessity of some external protector against Sparta,—and who even
before they applied to Thebes for aid, had solicited the like
interference from Athens (probably under the general presidency
accepted by Athens, and the oaths interchanged by her with various
inferior cities, since the battle of Leuktra), but had experienced a
refusal.[454]
Epaminondas had been preparing for this contingency ever since
the battle of Leuktra. The first use made of his victory had been to
establish or confirm the ascendency of Thebes both over the
recusant Bœotian cities and over the neighboring Phokians and
Lokrians, etc. After this had been accomplished, he must have been
occupied (during the early part of 370 B.C.) in anxiously watching the
movements of Jason of Pheræ,—who had already announced his
design of marching with an imposing force to Delphi for the
celebration of the Pythian games (about August 1.) Though this
despot was the ally of Thebes, yet as both his power, and his
aspirations towards the headship of Greece,[455] were well known,
no Theban general, even of prudence inferior to Epaminondas, could
venture in the face of such liabilities to conduct away the Theban
force into Peloponnesus, leaving Bœotia uncovered. The
assassination of Jason relieved Thebes from such apprehensions,
and a few weeks sufficed to show that his successors were far less
formidable in power as well as in ability. Accordingly, in the autumn
of 370 B.C. Epaminondas had his attention free to turn to
Peloponnesus, for the purpose both of maintaining the anti-Spartan
revolution which had taken place in Tegea, and of seconding the
pronounced impulse among the Arcadians towards federative
coalition.
But the purposes of this distinguished man went farther still;
embracing long-sighted and permanent arrangements, such as
should forever disable Sparta from recovering her prominent station
in the Grecian world. While with one hand he organized Arcadia,
with the other he took measures for replacing the exiled Messenians
on their ancient territory. To achieve this, it was necessary to
dispossess the Spartans of the region once known as independent
Messenia, under its own line of kings, but now, for near three
centuries, the best portion of Laconia, tilled by Helots for the profit
of proprietors at Sparta. While converting these Helots into free
Messenians, as their forefathers had once been, Epaminondas
proposed to invite back all the wanderers of the same race who
were dispersed in various portions of Greece; so as at once to
impoverish Sparta by loss of territory, and to plant upon her flank a
neighbor bitterly hostile. It has been already mentioned, that during
the Peloponnesian war, the exiled Messenians had been among the
most active allies of Athens and Sparta,—at Naupaktus, at
Sphakteria, at Pylus, in Kephallenia, and elsewhere. Expelled at the
close of that war by the triumphant Spartans,[456] not only from
Peloponnesus, but also from Naupaktus and Kephallenia, these exiles
had since been dispersed among various Hellenic colonies; at
Rhegium in Italy, at Messênê in Sicily, at Hesperides in Libya. From
404 B.C. (the close of the war) to 373 B.C., they had remained thus
without a home. At length, about the latter year (when the Athenian
confederate navy again became equal or superior to the
Lacedæmonian on the west coast of Peloponnesus), they began to
indulge the hope of being restored to Naupaktus.[457] Probably their
request may have been preferred and discussed in the synod of
Athenian allies, where the Thebans sat as members. Nothing
however had been done towards it by the Athenians,—who soon
became fatigued with the war, and at length made peace with
Sparta,—when the momentous battle of Leuktra altered, both
completely and suddenly, the balance of power in Greece. A chance
of protection was now opened to the Messenians from Thebes, far
more promising than they had ever had from Athens. Epaminondas,
well aware of the loss as well as humiliation that he should inflict
upon Sparta by restoring them to their ancient territory, entered into
communication with them, and caused them to be invited to
Peloponnesus from all their distant places of emigration.[458] By the
time of his march into Arcadia, in the late autumn of 370 B.C., many
of them had already joined him, burning with all their ancient hatred
of Sparta, and contributing to aggravate the same sentiment among
Thebans and allies.
With the scheme of restoring the Messenians, was combined in
the mind of Epaminondas another, for the political consolidation of
the Arcadians; both being intended as parts of one strong and self-
supporting organization against Sparta on her own border. Of course
he could have accomplished nothing of the kind, if there had not
been a powerful spontaneous movement towards consolidation
among the Arcadians themselves. But without his guidance and
protection, the movement would have proved abortive, through the
force of local jealousies within the country, fomented and seconded
by Spartan aid from without. Though the general vote for federative
coalition had been passed with enthusiasm, yet to carry out such a
vote to the satisfaction of all, without quarrelling on points of detail,
would have required far more of public-minded sentiment, as well as
of intelligence, than what could be reckoned upon among the
Arcadians. It was necessary to establish a new city; since the
standing jealousy between Mantinea and Tegea, now for the first
time embarked in one common cause, would never have permitted
that either should be preferred as the centre of the new
consolidation.[459] Besides fixing upon the new site required, it was
indispensable also to choose between conflicting exigencies, and to
break up ancient habits, in a way such as could hardly have been
enforced by any majority purely Arcadian. The authority here
deficient was precisely supplied by Epaminondas; who brought with
him a victorious army and a splendid personal name, combined with
impartiality as to the local politics of Arcadia, and single-minded
hostility to Sparta.
It was with a view to these two great foundations, as well as to
expel Agesilaus, that Epaminondas now marched the Theban army
into Arcadia; the command being voluntarily intrusted to him by
Pelopidas and the other Bœotarchs present. He arrived shortly after
the retirement of Agesilaus, while the Arcadians and Eleians were
ravaging the lands of the recusant town of Heræa. As they speedily
came back to greet his arrival, the aggregate confederate body,—
Argeians, Arcadians, and Eleians, united with the Thebans and their
accompanying allies,—is said to have amounted to forty thousand, or
according to some, even to seventy thousand men.[460] Not merely
had Epaminondas brought with him a choice body of auxiliaries,—
Phokians, Lokrians, Eubœans, Akarnanians, Herakleots, Malians, and
Thessalian cavalry and peltasts,—but the Bœotian bands themselves
were so brilliant and imposing, as to excite universal admiration. The
victory of Leuktra had awakened among them an enthusiastic
military ardor, turned to account by the genius of Epaminondas, and
made to produce a finished discipline which even the unwilling
Xenophon cannot refuse to acknowledge.[461] Conscious of the might
of their assembled force, within a day’s march of Laconia, the
Arcadians, Argeians, and Eleians pressed Epaminondas to invade
that country, now that no allies could approach the frontier to its aid.
At first he was unwilling to comply. He had not come prepared for
the enterprise; being well aware, from his own journey to Sparta
(when the peace-congress was held there prior to the battle of
Leuktra), of the impracticable nature of the intervening country, so
easy to be defended, especially during the winter-season, by troops
like the Lacedæmonians, whom he believed to be in occupation of all
the passes. Nor was his reluctance overcome until the instances of
his allies were backed by assurances from the Arcadians on the
frontier, that the passes were not all guarded; as well as by
invitations from some of the discontented Periœki, in Laconia. These
Periœki engaged to revolt openly, if he would only show himself in
the country. They told him that there was a general slackness
throughout Laconia in obeying the military requisitions from Sparta;
and tendered their lives as atonement if they should be found to
speak falsely. By such encouragements, as well as by the general
impatience of all around him to revenge upon Sparta her long career
of pride and abused ascendency, Epaminondas was at length
induced to give the order of invasion.[462]
That he should have hesitated in taking this responsibility, will
not surprise us, if we recollect, that over and above the real
difficulties of the country, invasion of Laconia by land was an
unparalleled phenomenon,—that the force of Sparta was most
imperfectly known,—that no such thought had been entertained
when he left Thebes,—that the legal duration of command, for
himself and his colleagues, would not permit it,—and that though his
Peloponnesian allies were forward in the scheme, the rest of his
troops and his countrymen might well censure him, if the unknown
force of resistance turned out as formidable as their associations
from old time led them to apprehend.
The invading army was distributed into four portions, all
penetrating by different passes. The Eleians had the westernmost
and easiest road, the Argeians the easternmost;[463] while the
Thebans themselves and the Arcadians formed the two central
divisions. The latter alone experienced any serious resistance. More
daring even than the Thebans, they encountered Ischolaus the
Spartan at Ium or Oeum in the district called Skiritis, attacked him in
the village, and overpowered him by vehemence of assault, by
superior numbers, and seemingly also by some favor or collusion[464]
on the part of the inhabitants. After a desperate resistance, this
brave Spartan with nearly all his division perished. At Karyæ, the
Thebans also found and surmounted some resistance; but the
victory of the Arcadians over Ischolaus operated as an
encouragement to all, so that the four divisions reached Sellasia[465]
and were again united in safety. Undefended and deserted
(seemingly) by the Spartans, Sellasia was now burnt and destroyed
by the invaders, who, continuing their march along the plain or
valley towards the Eurotas, encamped in the sacred grove of Apollo.
On the next day they reached the Eurotas, at the foot of the bridge
which crossed that river and led to the city of Sparta.
Epaminondas found the bridge too well-guarded to attempt
forcing it; a strong body of Spartan hoplites being also discernible on
the other side, in the sacred ground of Athênê Alea. He therefore
marched down the left bank of the river, burning and plundering the
houses in his way, as far as Amyklæ, between two and three miles
below Sparta. Here he found a ford, though the river was full, from
the winter season; and accomplished the passage, defeating, after a
severe contest, a body of Spartans who tried to oppose it. He was
now on the same side of the river as Sparta, to which city he slowly
and cautiously made his approach; taking care to keep his Theban
troops always in the best battle order, and protecting them, when
encamped, by felled trees; while the Arcadians and other
Peloponnesian allies dispersed around to plunder the neighboring
houses and property.[466]
Great was the consternation which reigned in the city; destitute
of fortifications, yet hitherto inviolate in fact and unassailable even in
idea. Besides their own native force, the Spartans had no auxiliaries
except those mercenaries from Orchomenus who had come back
with Agesilaus; nor was it certain beforehand that even these troops
would remain with them, if the invasion became formidable.[467] On
the first assemblage of the irresistible army on their frontier, they
had despatched one of their commanders of foreign contingents
(called Xenâgi) to press the instant coming of such Peloponnesian
allies as remained faithful to them; and also envoys to Athens,
entreating assistance from that city. Auxiliaries were obtained, and
rapidly put under march, from Pellênê, Sikyon, Phlius, Corinth,
Epidaurus, Trœzen, Hermionê, and Halieis.[468] But the ordinary line
of march into Laconia was now impracticable to them; the whole
frontier being barred by Argeians and Arcadians. Accordingly they
were obliged to proceed first to the Argolic peninsula, and from
thence to cross by sea (embarking probably at Halieis on the south-
western coast of the peninsula) to Prasiæ on the eastern coast of
Laconia; from whence they made their way over the Laconian
mountains to Sparta. Being poorly provided with vessels, they were
forced to cross in separate detachments, and to draw lots for
priority.[469] By this chance the Phliasian contingent did not come
over until the last; while the xenagus, eager to reach Sparta, left
them behind, and conducted the rest thither, arriving only just
before the confederate enemies debouched from Sellasia. The
Phliasians, on crossing to Prasiæ, found neither their comrades nor
the xenagus, but were obliged to hire a guide to Sparta. Fortunately
they arrived there both safely and in time, eluding the vigilance of
the enemy, who were then near Amyklæ.
These reinforcements were no less seasonable to Sparta, than
creditable to the fidelity of the allies. For the bad feeling which
habitually reigned in Laconia, between the Spartan citizens on one
side, and the Periœki and Helots on the other, produced in this hour
of danger its natural fruits of desertion, alarm, and weakness. Not
only were the Periœki and Helots in standing discontent, but even
among the Spartan citizens themselves, a privileged fraction called
Peers had come to monopolize political honors; while the remainder,
—poorer men, yet ambitious and active, and known under the
ordinary name of the Inferiors,—were subject to a degrading
exclusion, and rendered bitterly hostile. The account given in a
previous chapter of the conspiracy of Kinadon, will have disclosed
the fearful insecurity of the Spartan citizen, surrounded by so many
disaffected companions; Periœki and Helots in Laconia, inferior
citizens at Sparta. On the appearance of the invading enemy, indeed,
a certain feeling of common interest arose, since even the
disaffected might reasonably imagine that a plundering soldiery, if
not repelled at the point of the sword, would make their condition
worse instead of better. And accordingly, when the ephors made
public proclamation, that any Helot who would take heavy armor
and serve in the ranks as an hoplite, should be manumitted,—not
less than six thousand Helots gave in their names to serve. But a
body thus numerous, when seen in arms, became itself the object of
mistrust to the Spartans; so that the arrival of their new allies from
Prasiæ was welcomed as a security, not less against the armed
Helots within the city, than against the Thebans without.[470] Open
enmity, however, was not wanting. A considerable number both of
Periœki and Helots actually took arms on behalf of the Thebans;
others remained inactive, disregarding the urgent summons from the
ephors, which could not now be enforced.[471]
Under such wide-spread feelings of disaffection the defence even
of Sparta itself against the assailing enemy was a task requiring all
the energy of Agesilaus. After having vainly tried to hinder the
Thebans from crossing the Eurotas, he was forced to abandon
Amyklæ and to throw himself back upon the city of Sparta, towards
which they immediately advanced. More than one conspiracy was on
the point of breaking out, had not his vigilance forestalled the
projects. Two hundred young soldiers of doubtful fidelity were
marching, without orders, to occupy a strong post (sacred to
Artemis) called the Issorium. Those around him were about to attack
them, but Agesilaus, repressing their zeal, went up alone to the
band, addressed them in language betokening no suspicion, yet
warning them that they had mistaken his orders: their services were
needed, not at the Issorium, but in another part of the city. They
obeyed his orders, and moved to the spot indicated; upon which he
immediately occupied the Issorium with troops whom he could trust.
In the ensuing night, he seized and put to death fifteen of the
leaders of the two hundred. Another conspiracy, said to have been
on the point of breaking out, was repressed by seizing the
conspirators in the house where they were assembled, and putting
them to death untried; the first occasion (observes Plutarch) on
which any Spartan was ever put to death untried,[472]—a statement
which I hesitate to believe without knowing from whom he borrowed
it, but which, if true, proves that the Spartan kings and ephors did
not apply to Spartan citizens the same measure as to Periœki and
Helots.
By such severe proceedings, disaffection was kept under; while
the strong posts of the city were effectively occupied, and the wider
approaches barricaded by heaps of stones and earth.[473] Though
destitute of walls, Sparta was extremely defensible by position.
Epaminondas marched slowly up to it from Amyklæ; the Arcadians
and others in his army spreading themselves to burn and plunder
the neighborhood. On the third or fourth day his cavalry occupied
the Hippodrome (probably a space of level ground near the river,
under the hilly site of the town), where the Spartan cavalry, though
inferior both in number and in goodness, gained an advantage over
them, through the help of three hundred chosen hoplites whom
Agesilaus had planted in ambush hard by, in a precinct sacred to the
Dioskuri. Though this action was probably of little consequence, yet
Epaminondas did not dare to attempt the city by storm. Satisfied
with having defied the Spartans and manifested his mastery of the
field even to their own doors, he marched away southward down to
Eurotas. To them, in their present depression, it was matter of
consolation and even of boasting,[474] that he had not dared to
assail them in their last stronghold. The agony of their feelings,—
grief, resentment, and wounded honor,—was intolerable. Many
wished to go out and fight, at all hazard; but Agesilaus resisted them
with the same firmness as Perikles had shown at Athens, when the
Peloponnesians first invaded Attica at the beginning of the
Peloponnesian war. Especially the Spartan women, who had never
before beheld an enemy, are said to have manifested emotions so
furious and distressing, as to increase much the difficulty of defence.
[475] We are even told that Antalkidas, at that time one of the
ephors, sent his children for safety away from Sparta to the island of
Kythêra. Epaminondas knew well how desperate the resistance of
the Spartans would be if their city were attacked; while to himself, in
the midst of a hostile and impracticable country, repulse would be
absolute ruin.[476]
On leaving Sparta, Epaminondas carried his march as far as
Helos and Gythium on the sea-coast; burning and plundering the
country, and trying for three days to capture Gythium, which
contained the Lacedæmonian arsenal and ships. Many of the
Laconian Periœki joined and took service in his army; nevertheless
his attempt on Gythium did not succeed; upon which he turned back
and retraced his steps to the Arcadian frontier. It was the more
necessary for him to think of quitting Laconia, since his
Peloponnesian allies, the Arcadians and others, were daily stealing
home with the rich plunder which they had acquired, while his
supplies were also becoming deficient.[477]
Epaminondas had thus accomplished far more than he had
projected when quitting Thebes; for the effect of the expedition on
Grecian opinion was immense. The reputation of his army, as well as
his own, was prodigiously exalted; and even the narrative of
Xenophon, unfriendly as well as obscure, bears involuntary
testimony both to the excellence of his generalship and to the good
discipline of his troops. He made his Thebans keep in rank and hold
front against the enemy, even while their Arcadian allies were
dispersing around for plunder. Moreover, the insult and humiliation to
Sparta were still greater than that inflicted by the battle of Leuktra;
which had indeed shown that she was no longer invincible in the
field, but had still left her with the admitted supposition of an
inviolable territory and an unapproachable city.
The resistance of the Spartans indeed (except in so far as
regards their city) had been far less than either friends or enemies
expected; the belief in their power was thus proportionally abridged.
It now remained for Epaminondas to complete their humiliation by
executing those two enterprises which had formed the special
purpose of his expedition: the reëstablishment of Messênê, and the
consolidation of the Arcadians.
The recent invasion of Laconia, victorious as well as lucrative,
had inspired the Arcadians with increased confidence and antipathy
against Sparta, and increased disposition to listen to Epaminondas.
When that eminent man proclaimed the necessity of establishing a
strong frontier against Sparta on the side of Arcadia, and when he
announced his intention of farther weakening Sparta by the
restoration of the exiled Messenians,—the general feeling of the
small Arcadian communities, already tending in the direction of
coalescence, became strong enough to overbear all such
impediments of detail as the breaking up of ancient abode and habit
involves. Respecting early Athenian history, we are told by
Thucydides,[478] that the legendary Theseus, “having become
powerful, in addition to his great capacity,” had effected the
discontinuance of those numerous independent governments which
once divided Attica, and had consolidated them all into one common
government at Athens. Just such was the revolution now operated
by Epaminondas, through the like combination of intelligence and
power. A Board of Œkists or Founders was named to carry out the
resolution taken by the Arcadian assemblies at Asea and Tegea, for
the establishment of a Pan-Arcadian city and centre. Of this Board,
two were from Tegea, two from Mantinea, two from Kleitor, two from
the district of Menalus, two from that of the Parrhasians. A
convenient site being chosen upon the river Helisson (which flowed
through and divided the town in two), about twenty miles west of
Tegea, well-fitted to block up the marches of Sparta in a north-
westerly direction,—the foundation of the new Great City
(Megalopolis) was laid by the Œkists jointly with Epaminondas. Forty
distinct Arcadian townships,[479] from all sides of this centre, were
persuaded to join the new community. Ten were from the Mænalii,
eight from the Parrhasii, six from the Eutresii, three great sections of
the Arcadian name, each an aggregate of villages. Four little
townships, occupying a portion of the area intended for the new
territory, yet being averse to the scheme, were constrained to join;
but in one of them, Trapezus, the aversion was so strong, that most
of the inhabitants preferred to emigrate, and went to join the
Trapezuntines in the Euxine Sea (Trebizond), who received them
kindly. Some of the leading Trapezuntines were even slain by the
violent temper of the Arcadian majority. The walls of the new city
enclosed an area of fifty stadia in circumference (more than five
miles and a half); while an ample rural territory was also gathered
around it, extending northward as much as twenty-four miles from
the city, and conterminous on the east with Tegea, Mantinea,
Orchomenus, and Kaphyæ,—on the west with Messênê,[480] Phigalia,
and Heræa.
The other new city,—Messênê,—was founded under the joint
auspices of the Thebans and their allies, Argeians and others;
Epitelês being especially chosen by the Argeians for that purpose.
[481] The Messenian exiles, though eager and joyful at the thought of
regaining their name and nationality, were averse to fix their new
city either at Œchalia or Andania, which had been the scenes of their
calamities in the early wars with Sparta. Moreover the site of Mount
Ithômê is said to have been pointed out by the hero Kaukon, in a
dream, to the Ageian general Epitelês. The local circumstances of
this mountain (on which the last gallant resistance of the revolted
Messenians against Sparta had been carried on, between the Persian
and Peloponnesian wars) were such, that the indications of dreams,
prophets, and religious signs coincided fully with the deliberate
choice of a judge like Epaminondas. In after days, this hill Ithômê
(then bearing the town and citadel of Messênê), together with the
Akrocorinthus, were marked out by Demetrius of Pharus as the two
horns of Peloponnesus: whoever held these two horns, was master
of the bull.[482] Ithômê was near two thousand five hundred feet
above the level of the sea, having upon its summit an abundant
spring of water, called Klepsydra. Upon this summit the citadel or
acropolis of the new town of Messênê was built; while the town itself
was situated lower down on the slope, though connected by a
continuous wall with its acropolis. First, solemn sacrifices were
offered, by Epaminondas, who was recognized as Œkist or Founder,
[483] to Dionysius and Apollo Ismenius,—by the Argeians, to the
Argeian Hêrê and Zeus Nemeius,—by the Messenians, to Zeus
Ithomatês and the Dioskuri. Next, prayer was made to the ancient
Heroes and Heroines of the Messenian nation, especially to the
invincible warrior Aristomenes, that they would now come back and
again take up their residence as inmates in enfranchised Messênê.
After this, the ground was marked out and the building was begun,
under the sound of Argeian and Bœotian flutes, playing the strains
of Pronomus and Sakadas. The best masons and architects were
invited from all Greece, to lay out the streets with regularity, as well
as to ensure a proper distribution and construction of the sacred
edifices.[484] In respect of the fortifications, too, Epaminondas was
studiously provident. Such was their excellence and solidity, that
they exhibited matter for admiration even in the after-days of the
traveller Pausanias.[485]
From their newly-established city on the hill of Ithômê, the
Messenians enjoyed a territory extending fifteen miles southward
down to the Messenian Gulf, across a plain, then as well as now, the
richest and most fertile in Peloponnesus; while to the eastward, their
territory was conterminous with that of Arcadia and the
contemporary establishment of Megalopolis. All the newly-
appropriated space was land cut off from the Spartan dominion.
How much was cut off in the direction south-east of Ithômê (along
the north-eastern coast of the Messenian Gulf), we cannot exactly
say. But it would appear that the Periœki of Thuria, situated in that
neighborhood, were converted into an independent community and
protected by the vicinity of Messênê.[486] What is of more
importance to notice, however, is,—that all the extensive district
westward and south-westward of Ithômê,—all the south-western
corner of Peloponnesus, from the river Neda southward to Cape
Akritas,—was now also subtracted from Sparta. At the beginning of
the Peloponnesian war, the Spartan Brasidas had been in garrison
near Methônê[487] (not far from Cape Akritas); Pylus,—where the
Athenian Demosthenes erected his hostile fort, near which the
important capture at Sphakteria was effected,—had been a maritime
point belonging to Sparta, about forty-six miles from the city;[488]
Aulon (rather farther north, near the river Neda) had been at the
time of the conspiracy of Kinadon a township of Spartan Periœki, of
very doubtful fidelity.[489] Now all this wide area, from the north-
eastern corner of the Messenian Gulf westward, the best half of the
Spartan territory, was severed from Sparta to become the property
of Periœki and Helots, converted into freemen; not only sending no
rent or tribute to Sparta, as before, but bitterly hostile to her from
the very nature of their tenure. It was in the ensuing year that the
Arcadian army cut to pieces the Lacedæmonian garrison at Asinê,
[490] killing the Spartan polemarch Geranor; and probably about the
same time the other Lacedæmonian garrisons in the south-western
peninsula must have been expelled. Thus liberated, the Periœki of
the region welcomed the new Messênê as the guarantee of their
independence. Epaminondas, besides confirming the independence
of Methônê and Asinê, reconstituted some other towns,[491] which
under Lacedæmonian dominion had probably been kept unfortified
and had dwindled away.
In the spring of 425 B.C., when Demosthenes landed at Pylus,
Thucydides considers it a valuable acquisition for Athens, and a
serious injury to Sparta, to have lodged a small garrison of
Messenians in that insignificant post, as plunderers of Spartan
territory and instigators of Helots to desertion,[492]—especially as
their dialect could not be distinguished from that of the Spartans
themselves. How prodigious must have been the impression
throughout Greece, when Epaminondas, by planting the Messenian
exiles and others on the strong frontier city and position of Ithômê,
deprived Sparta in a short time of all the wide space between that
mountain and the western sea, enfranchising the Periœki and Helots
contained in it! We must recollect that the name Messênê had been
from old times applied generally to this region, and that it was never
bestowed upon any city before the time of Epaminondas. When
therefore the Spartans complained of “the liberation of
Messênê,”—“the loss of Messênê,”—they included in the word, not
simply the city on Mount Ithômê, but all this territory besides;
though it was not all comprised in the domain of the new city.
They complained yet more indignantly, that along with the
genuine Messenians, now brought back from exile,—a rabble of their
own emancipated Periœki and Helots had been domiciled on their
border.[493] Herein were included, not only such of these two classes
as, having before dwelt in servitude throughout the territory
westward of Ithômê, now remained there in a state of freedom—but
also doubtless a number of others who deserted from other parts of
Laconia. For as we know that such desertions had been not
inconsiderable, even when there was no better shelter than the
outlying posts of Pylus and Kythêra—so we may be sure that they
became much more numerous, when the neighboring city of
Messênê was founded under adequate protection, and when there
was a chance of obtaining, westward of the Messenian Gulf, free
lands with a new home. Moreover, such Periœki and Helots as had
actually joined the invading army of Epaminondas in Laconia, would
be forced from simple insecurity to quit the country when he retired,
and would be supplied with fresh residences in the newly-
enfranchised territory. All these men would pass at once, out of a
state of peculiarly harsh servitude, into the dignity of free and equal
Hellens,[494] sending again a solemn Messenian legation or Theôry to
the Olympic festival, after an interval of more than three centuries,
[495]—outdoing their former masters in the magnitude of their
offerings from the same soil,—and requiting them for previous ill-
usage by words of defiance and insult, instead of that universal
deference and admiration which a Spartan had hitherto been
accustomed to look upon as his due.
The enfranchisement and reörganization of all Western Laconia,
the renovation of the Messenian name, the foundation of the two
new cities (Messênê and Megalopolis) in immediate neighborhood
and sympathy,—while they completed the degradation of Sparta,
constituted in all respects the most interesting political phenomena
that Greece had witnessed for many years. To the profound
mortification of the historian,—he is able to recount nothing more
than the bare facts, with such inferences as these facts themselves
warrant. Xenophon, under whose eyes all must have passed,
designedly omits to notice them;[496] Pausanias, whom we have to
thank for most of what we know, is prompted by his religious
imagination to relate many divine signs and warnings, but little
matter of actual occurrence. Details are altogether withheld from us.
We know neither how long a time was occupied in the building of
the two cities, nor who furnished the cost; though both the one and
the other must have been considerable. Of the thousand new
arrangements, incident to the winding up of many small townships,
and the commencement of two large cities, we are unable to render
any account. Yet there is no point of time wherein social phenomena
are either so interesting or so instructive. In describing societies
already established and ancient, we find the force of traditional
routine almost omnipotent in its influence both on men’s actions and
on their feelings; bad as well as good is preserved in one concrete,
since the dead weight of the past stifles all constructive intelligence,
and leaves little room even for improving aspirations. But the forty
small communities which coalesced into Megalopolis, and the
Messenians and other settlers who came for the first time together
on the hill of Ithômê, were in a state in which new exigencies of
every kind pressed for immediate satisfaction. There was no file to
afford a precedent, nor any resource left except to submit all the
problems to discussion by those whose character and judgment was
most esteemed. Whether the problems were well- or ill-solved, there
must have been now a genuine and earnest attempt to strike out as
good a solution as the lights of the time and place permitted, with a
certain latitude for conflicting views. Arrangements must have been
made for the apportionment of houses and lands among the citizens,
by purchase, or grant, or both together; for the political and judicial
constitution; for religious and recreative ceremonies, for military
defence, for markets, for the security and transmission of property,
etc. All these and many other social wants of a nascent community
must now have been provided for, and it would have been highly
interesting to know how. Unhappily the means are denied to us. We
can record little more than the bare fact that these two youngest
members of the Hellenic brotherhood of cities were born at the
same time, and under the auspices of the same presiding genius,
Epaminondas; destined to sustain each other in neighborly sympathy
and in repelling all common danger from the attacks of Sparta; a
purpose, which, even two centuries afterwards, remained engraven
on the mind of a Megalopolitan patriot like Polybius.[497]
Megalopolis was intended not merely as a great city in itself, but
as the centre of the new confederacy; which appears to have
comprised all Arcadia, except Orchomenus and Heræa. It was
enacted that a synod or assembly, from all the separate members of
the Arcadian name, and in which probably every Arcadian citizen
from the constituent communities had the right of attending, should
be periodically convoked there. This assembly was called the Ten
Thousand, or the Great Number. A body of Arcadian troops, called
the Epariti, destined to uphold the federation, and receiving pay
when on service, was also provided. Assessments were levied upon
each city for their support, and a Pan-Arcadian general (probably
also other officers) was named. The Ten Thousand, on behalf of all
Arcadia, received foreign envoys,—concluded war, or peace, or
alliance,—and tried all officers or other Arcadians brought before
them on accusations of public misconduct.[498] The great Athenian
orators, Kallistratus, Demosthenes, Æschines, on various occasions
pleaded before it.[499] What were its times of meeting, we are
unable to say. It contributed seriously, for a certain time, to sustain a
Pan-Arcadian communion of action and sentiment which had never
before existed;[500] and to prevent, or soften, those dissensions
which had always a tendency to break out among the separate
Arcadian cities. The patriotic enthusiasm, however, out of which
Megalopolis had first arisen, gradually became enfeebled. The city
never attained that preëminence or power which its founders
contemplated, and which had caused the city to be laid out on a
scale too large for the population actually inhabiting it.[501]
Not only was the portion of Laconia west of the Messenian Gulf
now rendered independent of Sparta, but also much of the territory
which lies north of Sparta, between that city and Arcadia. Thus the
Skiritæ (hardy mountaineers of Arcadian race, heretofore dependent
upon Sparta, and constituting a valuable contingent to her armies),
[502] with their territory forming the northern frontier of Laconia
towards Arcadia, became from this time independent of and hostile
to Sparta.[503] The same is the case even with a place much nearer
to Sparta,—Sellasia; though this latter was retaken by the
Lacedæmonians four or five years afterwards.[504]
Epaminondas remained about four months beyond the legal
duration of his command in Arcadia and Laconia.[505] The sufferings
of a severe mid-winter were greatly mitigated to his soldiers by the
Arcadians, who, full of devoted friendship, pressed upon them an
excess of hospitality which he could not permit consistently with his
military duties.[506] He stayed long enough to settle all the
preliminary debates and difficulties, and to put in train of serious
execution the establishment of Messênê and Megalopolis. For the
completion of a work thus comprehensive, which changed the face
and character of Peloponnesus, much time was of course necessary.
Accordingly, a Theban division under Pamenes was left to repel all
obstruction from Sparta;[507] while Tegea also, from this time
forward, for some years, was occupied as a post by a Theban
harmost and garrison.[508]
Meanwhile the Athenians were profoundly affected by these
proceedings of Epaminondas in Peloponnesus. The accumulation of
force against Sparta was so powerful, that under a chief like him, it
seemed sufficient to crush her; and though the Athenians were now
neutral in the contest, such a prospect was not at all agreeable to
them,[509] involving the aggrandizement of Thebes to a point
inconsistent with their security. It was in the midst of the successes
of Epaminondas that envoys came to Athens from Sparta, Corinth,
and Phlius, to entreat her aid. The message was one not merely
humiliating to the Lacedæmonians, who had never previously sent
the like request to any Grecian city,—but also difficult to handle in
reference to Athens. History showed abundant acts of jealousy and
hostility, little either of good feeling or consentient interest, on the
part of the Lacedæmonians towards her. What little was to be found,
the envoys dexterously brought forward; going back to the
dethronement of the Peisistratids from Athens by Spartan help, the
glorious expulsion of Xerxes from Greece by the joint efforts of both
cities,—and the auxiliaries sent by Athens into Laconia in 465 B.C., to
assist the Spartans against the revolted Messenians on Mount
Ithômê. In these times (he reminded the Athenian assembly) Thebes
had betrayed the Hellenic cause by joining Xerxes, and had been an
object of common hatred to both. Moreover the maritime forces of
Greece had been arrayed under Athens in the Confederacy of Delos,
with full sanction and recommendation from Sparta; while the
headship of the latter by land had in like manner been accepted by
the Athenians. He called on the assembly, in the name of these
former glories, to concur with Sparta in forgetting all the deplorable
hostilities which had since intervened, and to afford to her a
generous relief against the old common enemy. The Thebans might
even now be decimated (according to the vow said to have been
taken after the repulse of Xerxes), in spite of their present menacing
ascendency,—if Athens and Sparta could be brought heartily to
coöperate; and might be dealt with as Thebes herself had wished to
deal with Athens after the Peloponnesian war, when Sparta refused
to concur in pronouncing the sentence of utter ruin.[510]
This appeal from Sparta was earnestly seconded by the envoys
from Corinth and Phlius. The Corinthian speaker contended, that
Epaminondas and his army, passing through the territory of Corinth
and inflicting damage upon it in their passage into Peloponnesus,
had committed a glaring violation of the general peace, sworn in 371
B.C., first at Sparta and afterwards at Athens, guaranteeing universal
autonomy to every Grecian city. The envoy from Phlius,—while
complimenting Athens on the proud position which she now held,
having the fate of Sparta in her hands,—dwelt on the meed of honor
which she would earn in Greece, if she now generously interfered to
rescue her ancient rival, forgetting past injuries and remembering
only past benefits. In adopting such policy, too, she would act in
accordance with her own true interests; since, should Sparta be
crushed, the Thebans would become undisputed heads of Greece,
and more formidable still to Athens.[511]
It was not among the least marks of the prostration of Sparta,
that she should be compelled to send such an embassy to Athens,
and to entreat an amnesty for so many untoward realities during the
past. The contrast is indeed striking, when we set her present
language against that which she had held respecting Athens, before
and through the Peloponnesian war.
At first, her envoys were heard with doubtful favor; the
sentiment of the assembly being apparently rather against than for
them. “Such language from the Spartans (murmured the assembled
citizens) is intelligible enough during their present distress; but so
long as they were in good circumstances, we received nothing but
ill-usage from them.”[512] Nor was the complaint of the Spartans,
that the invasion of Laconia was contrary to the sworn peace
guaranteeing universal autonomy, admitted without opposition.
Some said that the Lacedæmonians had drawn the invasion upon
themselves, by their previous interference with Tegea and in
Arcadia; and that the intervention of the Mantineans at Tegea had
been justifiable, since Stasippus and the philo-Laconian party in that
city had been the first to begin unjust violence. On the other hand,
the appeal made by the envoys to the congress of Peloponnesian
allies held in 404 B.C., after the surrender of Athens,—when the
Theban deputy had proposed that Athens should be totally
destroyed, while the Spartans had strenuously protested against so
cruel a sentence—made a powerful impression on the assembly, and
contributed more than anything else to determine them in favor of
the proposition.[513] “As Athens was then, so Sparta is now, on the
brink of ruin, from the fiat of the same enemy: Athens was then
rescued by Sparta, and shall she now leave the rescue unrequited?”
Such was the broad and simple issue which told upon the feelings of
the assembled Athenians, disposing them to listen with increasing
favor both to the envoys from Corinth and Phlius, and to their own
speakers on the same side.
To rescue Sparta, indeed, was prudent as well as generous. A
counterpoise would thus be maintained against the excessive
aggrandizement of Thebes, which at this moment doubtless caused
serious alarm and jealousy to the Athenians. And thus, after the first
ebullition of resentment against Sparta, naturally suggested by the
history of the past, the philo-Spartan view of the situation gradually
became more and more predominant in the assembly.
Kallistratus[514] the orator spoke eloquently in support of the
Lacedæmonians; while the adverse speakers were badly listened to,
as pleading in favor of Thebes, whom no one wished to aggrandize
farther. A vote, decisive and enthusiastic, was passed for assisting
the Spartans with the full force of Athens; under the command of
Iphikrates, then residing as a private citizen[515] at Athens, since the
peace of the preceding year, which had caused him to be recalled
from Korkyra.
As soon as the sacrifices, offered in contemplation of this
enterprise were announced to be favorable, Iphikrates made
proclamation that the citizens destined for service should equip
themselves and muster in arms in the grove of Akadêmus (outside
the gates), there to take their evening meal, and to march the next
morning at daybreak. Such was the general ardor, that many citizens
went forth from the gates even in advance of Iphikrates himself; and
the total force which followed him is said to have been twelve
thousand men,—not named under conscription by the general, but
volunteers.[516] He first marched to Corinth, where he halted some
days; much to the discontent of his soldiers, who were impatient to
accomplish their project of carrying rescue to Sparta. But Iphikrates
was well aware that all beyond Corinth was hostile ground, and that
he had formidable enemies to deal with. After having established his
position at Corinth, and obtained information regarding the enemy,
he marched into Arcadia, and there made war without any important
result. Epaminondas and his army had quitted Laconia, while many
of the Arcadians and Eleians had gone home with the plunder
acquired; so that Sparta was, for the time, out of danger. Impelled in
part by the recent manifestation of Athens,[517] the Theban general
himself soon commenced his march of return into Bœotia, in which it
was necessary for him to pass the line of Mount Oneium between
Corinth and Kenchreæ. This line was composed of difficult ground,
and afforded good means of resistance to the passage of an army;
nevertheless Iphikrates, though he occupied its two extremities, did
not attempt directly to bar the passage of the Thebans. He
contented himself with sending out from Corinth all his cavalry, both
Athenian and Corinthian, to harass them in their march. But
Epaminondas beat them back with some loss, and pursued them to
the gates of Corinth. Excited by this spectacle, the Athenian main
body within the town were eager to march out and engage in
general battle. Their ardor was however repressed by Iphikrates;
who, refusing to go forth, suffered the Thebans to continue their
retreat unmolested.[518]
On returning to Thebes, Epaminondas with Pelopidas and the
other Bœotarchs, resigned the command. They had already retained
it for four months longer than the legal expiration of their term.
Although, by the constitutional law of Thebes, any general who
retained his functions longer than the period fixed by law was
pronounced worthy of death, yet Epaminondas, while employed in
his great projects for humiliating Sparta and founding the two hostile
cities on her border, had taken upon himself to brave this illegality,
persuading all his colleagues to concur with him. On resigning the
command, all of them had to undergo that trial of accountability
which awaited every retiring magistrate, as a matter of course,—but
which, in the present case, was required on special ground, since all
had committed an act notoriously punishable as well as of
dangerous precedent. Epaminondas undertook the duty of defending
his colleagues as well as himself. That he as well as Pelopidas had
political enemies, likely to avail themselves of any fair pretext for
accusing him,—is not to be doubted. But we may well doubt,
whether on the present occasion any of these enemies actually came
forward to propose that the penalty legally incurred should be
inflicted; not merely because this proposition, in the face of a
victorious army, returning elate with their achievements and proud
of their commanders, was full of danger to the mover himself,—but
also for another reason,—because Epaminondas would hardly be
imprudent enough to wait for the case to be stated by his enemies.
Knowing that the illegality committed was flagrant and of hazardous
example,—having also the reputation of his colleagues as well as his
own to protect,—he would forestall accusation by coming forward
himself to explain and justify the proceeding. He set forth the
glorious results of the expedition just finished; the invasion and
devastation of Laconia, hitherto unvisited by any enemy,—the
confinement of the Spartans within their walls,—the liberation of all
Western Laconia, and the establishment of Messênê as a city,—the
constitution of a strong new Arcadian city, forming, with Tegea on
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like