Showing posts with label TGT. Show all posts
Showing posts with label TGT. Show all posts

Thursday, November 28, 2024

Snowflake's REDUCE Function to Glean Insights from SEC Filing Data

 Summary

  • What is the REDUCE Higher-order Function?
  • Learn the JSON structure of the SEC company filing from an example.
  • What fiscal end periods are represented in the JSON document?
  • Answer the question using the REDUCE higher-order function in Snowflake.

What is the REDUCE Higher-order Function?

Recently, Snowflake made REDUCE Higher-order function generally available. This function adds another powerful, easy-to-use tool to your toolkit to process arrays. The REDUCE function allows you to accumulate values across an array into a single value. It takes an array as input, an initial accumulator value, and a Lambda expression that defines the logic for processing each array element.

REDUCE( <array> , <init> , <lambda_expression> ) 

The JSON Structure of the SEC Filing

My goal is to understand the cash carried by Kimberly-Clark Corporation in its balance sheet. The company is known for its products, such as Huggies and Cottonelle. I want to list all the fiscal end dates in the data. There can be inconsistencies in the data filed with the SEC, especially concerning the fiscal periods represented, so knowing what fiscal periods are in the data can be invaluable. Also, the SEC filing may have repeated data. This is because investors wish to compare current results with past results, so a Q2 report should include Q1 and Q2 data from the previous year. So, the SEC filing would have repetitions.

Note: You can learn about my External Table structure here. In my LinkedIn profile, you can read a series of blogs about my setup to query SEC filings.

Here's the JSON structure we will use in the REDUCE function:

{ 
"cik": 55785, 
"description": "Amount of currency on hand as well 
as demand deposits with banks or financial institutions. 
Includes other kinds of accounts that have the general characteristics of 
demand deposits.", 
"entityName": "KIMBERLY-CLARK CORPORATION", 
"label": "Cash and Cash Equivalents, at Carrying Value", 
"tag": "CashAndCashEquivalentsAtCarryingValue", 
"taxonomy": "us-gaap", 
"units":  { 
"USD": [
                  { 
                    "accn": "0001193125-10-038621", 
                    "end": "2006-12-31", 
                    "filed": "2010-02-24", 
                    "form": "10-K", 
                    "fp": "FY", 
                    "frame": "CY2006Q4I", 
                    "fy": 2009, 
                    "val": 361000000 
                  }, 
                  {
                    "accn": "0000055785-09-000026", 
                    "end": "2007-12-31", 
                    "filed": "2009-08-07", 
                    "form": "10-Q", 
                    "fp": "Q2", 
                    "fy": 2009, 
                    "val": 473000000
                  }
               ]
                }
}

What fiscal end periods are represented in the JSON document?

I have created an external table called CONS_STAPLES_CASH_AND_CASH_EQUIVALENTS. For the REDUCE function, the input is the path to the array:

Path to the Array Elements:

VALUE:"units":"USD" 

I wish to get a concatenated string of all the fiscal end periods represented in the JSON document. This is represented by the "end" key. This is represented in the init parameter as ''. Finally, in the Lambda Expression, the arg1 argument is the accumulator, and the arg2 argument is the current element being processed in the array.

Lambda Expression and the Query:

(arg1, arg2) -> arg1 || ' ' || arg2:"end" || ', '
SELECT 
            TICKER_SYMBOL, 
            VALUE, 
            REDUCE(VALUE:"units":"USD", '',  (arg1, arg2) -> arg1 || ' ' || arg2:"end" || ', ')           
                                                                                             FISCAL_PERIOD_END_DATES 
FROM 
            CONS_STAPLES_CASH_AND_CASH_EQUIVALENTS_ET;

When I execute the query, the REDUCE function retrieves the value for the "end" key, concatenates it to the accumulator, and returns it (Exhibit 1). The screenshot shows that for Kimberly-Clark Corp (KMB), the JSON has data from the fiscal period ending 2006-12-31. But for Target (TGT), the data in the JSON is from 2016-01-30.

Exhibit 1: The Fiscal Period End Date Returned by the REDUCE function.

Snowflake Snowsight

I can also tell that the SEC filing has duplicate data that I must handle in my query. For example, I can see that the 2007-12-31 is represented multiple times in the file I downloaded from the SEC (Exhibit 2).

Exhibit 2: Fiscal Period End Dates Accumulated By the REDUCE Higher-order Function.

SEC.GOV

I can quickly see the data in my JSON files downloaded from the SEC. I did not have to use a LATERAL FLATTEN to get at the data. The REDUCE function boosts my efficiency when I am dealing with JSON data. Try out Snowflake's REDUCE and other Higher-order functions; they will make you more productive.

Sunday, October 20, 2024

The Costco Paradox

What can we learn from the success of Costco?

Summary:

  • An analysis of Costco and Walmart's revenue growth over the past eight years.
  • A look at the gross margins of these two retailers.
  • An analysis of the inventory costs of these retailers.

Costco (COST) is one of the most successful retailers in the world. It has a loyal customer base, its employees are among the highest paid in the retail sector, and that leads to lower employee turnover, and it has a very generous return policy, furthering its customer loyalty. The company presents multiple paradoxes. Here are just a few:

  • How is Costco, with such low gross margins, not only still in business but thriving in the highly competitive retail sector?
  • How does Costco succeed in the internet era when its e-commerce strategy is an afterthought?
  • How does a retailer who pays and treats employees so well, but still manages to deliver superior shareholder returns?

Each retail company is unique in its own way. In many ways, uniquesness is a required feature for retailers. If a retailer is unable to distinguish themselves from the competition, they will not last long. Even among a crowded field of retailers, Costco and Trader Joe's standout. About 80% of products Trader Joe's sells is private label. In comparison, the U.S., with companies with strong brands and billions in marketing budgets, has seen only a 20% penetration by private label brands. Other retailers are yet to replicate Trader Joe's success in private label. Costco, for its part, does well with its Kirkland private label brand, selling many products under this label. Since this is an article about Costco, let's turn our attention to this great American company.

Costco Wholesale is unique in it own way. The way company operates and caters to its customers is a study in human psychology. Over 90% of its members renew each year. The store delivers a treasure hunt experience because you never know what you will find in each aisle. The aisles remain unmarked yet customers aren't frustrated. Over the years Costco has trained its customers to have a mental map of where they could typically find essential items. For example, paper towels and cleaning supplies are typically found at the back of the store.

Costco's executive memberships cost $130 annually yet, over 35 million out of their 76 million total members chose this level rather than pay $65 for the Gold Star membership (Exhibit 1). People perceive much value received from their executive membership. Members know Costco will never overcharge them. The company prides itself in keeping its mark-up 14%-15% above its costs, an extremely low number for a retailer. Costco pays a 2% reward on purchases to their executive members which many feel will help them recoup their membership cost. This reward eats into their already tiny margins, but Costco chose loyal customer base over higher margins. I am willing to theorize that consumers, if given a choice to pick between Amazon Prime and Costco memberships, will overwhelmingly pick Costco.

Exhibit 1: Costco Q4 FY 2024 Membership Numbers and Renewal Rate.

Costco Membership Numbers.
Source: Costco Investor Relations.

What are Costco's Revenue and Growth Rate?

Since 2008, Costco has increased its revenue by 3.5x, from $72 billion to $254 billion in 2024 (Exhibit 2). During the same period, Walmart (WMT), a much larger company, increased its revenue by 1.7x, from $377 billion in 2008 to $648 billion in 2024 (Exhibit 3). Just when people think that the market is saturated with Costco Warehouses, it finds new locations and customers. It has been expanding in China for years, although this comes with a side of geopolitical risk.

Exhibit 2: Costco Wholesale Revenue (2008 - 2024)

Costco Wholesale Revenue from 2008 to 2024.
SEC.GOV, Snowflake Snowsight

Exhibit 3: Walmart Revenue (2008 - 2024)

Walmart Revenue 2008 - 2024
SEC.GOV

Costco's revenue grew at an average annual rate of 8.2% between 2008 and 2024. But, if you remove the pandemic-era binge shopping between 2020 and 2022, the growth rate was 6.9%, still an impressive number. Walmart averaged a revenue growth rate of 3.4% between 2008 and 2024, including the pandemic years.

Exhibit 4: Costco's Annual Revenue Growth Rate.

Costco Revenue Growth Rate.
Snowflake Cortex Analyst, Excel

Exhibit 5: Walmart's Annual Revenue Growth Rate.

Walmart Annual Revenue Growth Rate
Snowflake Cortex Analyst, Excel

What are Costco's Gross Margins?

Costco has one of the lowest gross margins among retailers. Costco's gross margin in 2024 was 12.6% compared to 27.6% for Target (TGT), and 24.3% for Walmart. This is by design and may be their secret weapon. A company has to have strict financial discipline when it starts off with such low gross margins. Richard Galanti, the former CFO of Costco, was adept at managing costs. For the most part he was Costco's voice in Wall Street, presenting at the company quarterly earnings calls. Richard managed Costco's investments well, from inventory costs, new store openings, and e-commerce expenditures.

Costco's gross margins are well below that of Target and Walmart.

Exhibit 6: Gross Margins of Target, Walmart, and Costco.

Gross Margins of Target, Walmart and Costco.
SEC.GOV

How does Costco's Inventory Costs Compare with Walmart's and Target's?

Inventory is one of the largest costs for any retailer. When managed efficiently, inventory can boost operating cashflows and margins. When managed poorly, inventory can lead to losses or worse, bankruptcy.

Days of Sales in Inventory ( DSI) is a good metric to measure the efficiency of a company's inventory costs. This ratio indicates the average time in days it takes a company to sell its inventory. This metric also helps comparing inventory management efficiency across companies in a sector. Costco carries the least amount of inventory as possible on its balance sheet. It also helps that its loyal customer base regularly shops at the stores and helps clean out their inventory quickly.

Costco manages its inventory very efficiently compared to Walmart or Target. Costco manages to turnover its inventory every 31 days compared to nearly 41 days for Walmart and 56 days for Target (Exhibit 7 & 8). I have used ending inventory for each fiscal year in this calculation. When the ending inventory is used to calculate the days sales in inventory, the average number of days for Costco to turnover its inventory is 31.2 days.

Exhibit 7: Days Sales In Inventory For Walmart, Target, Costco.

Days Sales In Inventory for Walmart, Costco, Target.
Snowflake Snowsight

Exhibit 8: Costco Revenue, COGS, Gross Margin, and Days Sales in Inventory (Using Ending Inventory)

Inventory Costs Costco
Snowflake, Excel

In Exhibit 9, I have used the average inventory to calculate the days sales in inventory. The average number of days it takes Costco to turnver its inventory in this case is 29.9 days.

Exhibit 9: Costco Revenue, COGS, Gross Margin, and Days Sales in Inventory (Using Average Inventory)

Days Sales in Inventory Using Average Inventory Costs.
Snowflake, Excel.

Costco teaches us that margins are just a number. How you manage that efficiently while focusing on delivering value to the customer is what makes or breaks a company. Costco focus on keeping costs low for their customers helps it sell more stuff faster reducing its inventory costs and giving it enormous clout over its suppliers.

Finally, I have used Snowflake Data Cloud for almost all of my analysis. Snowflake platform is easy to use to gain business insights. I have shown you example of that here.

Disclosures: I am a Sales Engineer at Snowflake. You can reach me here. All opinions in this blog post are solely mine and do not reflect Snowflake's views. I am not a Registered Investment Advisor, and any discussion on securities or investments is not an inducement to make a particular investment.

How Much Does Coca-Cola Spend on Advertising?

Coke's AI Generated Ad (Source: WSJ.com) Ads are meant to evoke a reaction, an emotion, and an action. Great ads can bring you t...