Phrazor SDK
Get API KeyPhrazor API
  • 👋Welcome
  • Docs
    • ⚡Quick Start
    • 🔑Get your API Key
    • Documentation
      • 📥Download and Import
      • 🔗Connect your Data
      • 🛠️Setup your Analysis
        • Descriptor
        • Change
        • Trend
        • Compare
        • Target vs Achievement
        • Budget vs Expense
        • Others
          • Filter your Data
      • 📋Generate your Insights
      • 📝Generate your Summary
      • 🔌Integrations
      • 💣Rate Limits
Powered by GitBook
On this page
  • Input Combinations
  • Topics
  • Examples
  • Generate Insights by Analysis
  • Generate Insights by Topics
  1. Docs
  2. Documentation
  3. Setup your Analysis

Trend

PreviousChangeNextCompare

Last updated 1 year ago

Trend Analysis examines how well a particular dimension performs over a specific time frame. It tells us how steady or inconsistent this performance has been. Furthermore, it highlights the longest periods of continuous improvement and decline. This analysis is useful for spotting any unusual patterns or fluctuations in a metric's behavior.

Input Combinations

There are several different input combinations that you can leverage to bring out the different types of insights we offer for the Trend analysis.

Sr No
Combination
1

Date and Metric

2

Date, Metric and Dimension

(focus_on_value parameter is mandatory or else system will select the first value by default)

All the above mentioned input combinations are to be set using method, with the exception of focus_on_value, which should be configured using the method.

Topics

This section gives description about the topics that are associated with Trend Analysis. You can choose the topics of your choice to generate insights according to your requirements.

Topic
Description

trend_primary

Focuses on the primary or dominant trend within the data. It highlights the most prominent and consistent pattern observed over a specified period. Input - Date and Metric

growing_trend

Provides insights that identifies and analyzes trends characterized by consistent growth. It sheds light on instances where the specified focus_on_value within the dimension consistently increases in value over time wrt defined metric. Input - Date, Metric, Dimension and focus_on_value

declining_trend

Provides insights that identifies and analyzes trends characterized by consistent decline. It sheds light on instances where the specified focus_on_value within the dimension consistently decreases in value over time wrt defined metric. Input - Date, Metric, Dimension and focus_on_value

growing_or_declining_trend

Offers insight on a comprehensive view of both growing and declining trends within the data. It identifies instances of consistent growth and decline, offering a balanced perspective on changing patterns. Input - Date, Metric, Dimension and focus_on_value

growing_or_declining_2d

Provides insights on growing or declining trend of a dimension for the given metric and calculates growth or decline(Change) for the other dimension based on that value/entity.

Input - Date, Metric, 2 Dimensions and focus_on_value Requires two dimensions in input.

trend_other

Gives other miscellaneous insights. Input - Date and Metric / Date, Metric, Dimension and focus_on_value

Examples

Generate Insights by Analysis

Generate Insights on Trend of Weekly Sales.

# Set column meta according to the input combination.
phrzr.set_column_meta(
    date_column={"name": "Date", "period": "week"},
    metric_column="Sales"
)

insights = phrzr.get_insights('trend')

print(insights)

We can even find out the Weekly Sales Trend of the South Region as follow:

# Set column meta according to the input combination.
phrzr.set_column_meta(
    date_column={"name": "Date", "period": "week"},
    metric_column="Sales",
    dimension_column="Region" 
)

insights = phrzr.get_insights('trend', focus_on_value="South")

print(insights)

Generate Insights by Topics

Let's analyze and identify the Regions with growth and decline in monthly Sales Trend.

# Set column meta according to the topic input combination.
phrzr.set_column_meta(
    date_column={"name": "Date", "period": "month"},
    metric_column="Sales",
    dimension_column="Region" 
)

insights = phrzr.get_insights(["growing_trend", "declining_trend"])

print(insights)

Let's dive deeper to pinpoint the specific State within the declining Region that has a falling trend.

# Set column meta according to the topic input combination.
phrzr.set_column_meta(
    date_column={"name": "Date", "period": "month"},
    metric_column="Sales",
    dimension_column=["Region","State"]
)

insights = phrzr.get_insights(["growing_or_declining_2d"])

print(insights)
🛠️
get_insights
set_column_meta