sel
a,
b,
rank() over(order by c)
from table1
August 14, 2019
July 25, 2019
Teradata SQL Regular Expression to compare date format
Verify if date is in format dd-MMM-yyyy
select
regexp_similar(a_date,'^(([0-9])|([0-2][0-9])|([3][0-1]))\-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\-\d{4}$') = 1
from table1
select
regexp_similar(a_date,'^(([0-9])|([0-2][0-9])|([3][0-1]))\-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\-\d{4}$') = 1
from table1
June 21, 2019
WITH clause in Teradata SQL
WITH CTE1 AS (select current_date as today) select today from CTE1;
Ref: http://dwgeek.com/teradata-with-clause-syntax-usage-and-examples.html/
April 17, 2019
Apple Qualcomm settlement
Interesting read: https://9to5mac.com/2019/04/17/apple-qualcomm-and-intel/
Graphical diagram explaining players involved and their roles.
Graphical diagram explaining players involved and their roles.
Semantic Triple in RDF
Composed of:
Subject -> Predicate -> Object
A subject: which is a URI (e.g., a "web address") that represents something.
A predicate: which is another URI that represents a certain property of the subject.
An object: which can be a URI or a literal (a string) that is related to the subject
Example:
Bob knows John
http://example.name#BobSmith12 http://xmlns.com/foaf/0.1/knows http://example.name#JohnDoe34
Ref: https://data-gov.tw.rpi.edu/wiki/A_crash_course_in_SPARQL
https://en.wikipedia.org/wiki/Semantic_triple
John's age 70
http://example.name#JohnDoe34 http://xmlns.com/foaf/0.1/age 70
We can infer from the above 2 statements that Bob know somebody who is 70 years old
Subject -> Predicate -> Object
A subject: which is a URI (e.g., a "web address") that represents something.
A predicate: which is another URI that represents a certain property of the subject.
An object: which can be a URI or a literal (a string) that is related to the subject
Example:
Bob knows John
http://example.name#BobSmith12 http://xmlns.com/foaf/0.1/knows http://example.name#JohnDoe34
Ref: https://data-gov.tw.rpi.edu/wiki/A_crash_course_in_SPARQL
https://en.wikipedia.org/wiki/Semantic_triple
John's age 70
http://example.name#JohnDoe34 http://xmlns.com/foaf/0.1/age 70
We can infer from the above 2 statements that Bob know somebody who is 70 years old
April 16, 2019
Apache Jena RDF API
Abstractions
Resource: representing an RDF resource (whether named with a URI or anonymous)
Literal: for data values (numbers, strings, dates, etc)
Statement: representing an RDF triple and
Model: representing the whole graph
Ref: https://jena.apache.org/about_jena/architecture.html
Resource: representing an RDF resource (whether named with a URI or anonymous)
Literal: for data values (numbers, strings, dates, etc)
Statement: representing an RDF triple and
Model: representing the whole graph
Ref: https://jena.apache.org/about_jena/architecture.html
April 10, 2019
Spread
Offer/Ask price: $100.50
Bid price: $99.50
Spread = 100.50 - 99.50 = $1.00
FIX protocol and FIXadtl
Financial Information eXchange (FIX) is a messaging protocol used to exchange trade related messages between trading systems.
FIXatdl (FIX algorithm trading definition language) is a language for trading that relies on FIX protocol.
FIXatdl (FIX algorithm trading definition language) is a language for trading that relies on FIX protocol.
March 29, 2019
Basis Points
1 basis point = 1/100 of a percentage. Used mainly in Finance like changes in interest rate.
Example:
Example:
"The Federal Open Market Committee unanimously voted to increase the federal funds rate by 25 basis points to 1.75% to 2%" https://www.housingwire.com/articles/43672-fed-raises-rates-for-second-time-in-2018
Unicorn
With many unicorn IPOs getting listed in 2019, one question is "what is a unicorn?"
Wikipedia states:
Unicorn is a privately held company valued over $1 billion. The term was coined after the mythical animal due to the statistical rarity of such successful ventures.
NYTimes in an article on March 28, 2019 (day before the Lyft IPO) https://www.nytimes.com/2019/03/28/business/startups-ipo.html?action=click&module=Top%20Stories&pgtype=Homepage has an observation about why some startups with high valuations stay private for long.
Wikipedia states:
Unicorn is a privately held company valued over $1 billion. The term was coined after the mythical animal due to the statistical rarity of such successful ventures.
NYTimes in an article on March 28, 2019 (day before the Lyft IPO) https://www.nytimes.com/2019/03/28/business/startups-ipo.html?action=click&module=Top%20Stories&pgtype=Homepage has an observation about why some startups with high valuations stay private for long.
"Some industry groups and investors who urge fewer regulations say the emphasis on the private markets is an outgrowth of the Sarbanes-Oxley Act, the federal law passed in 2002 that tightened accounting rules for public companies after the accounting scandals of the early 2000s."
March 25, 2019
Spider - SPDR
Stands for Standard & Poor’s Depository Receipt. It is a S&P 500 index based ETF maintained by State Street Global Advisors. Each share of the ETF contains a 10th of the S&P 500 index and traded at roughly a 10th of the dollar value of S&P 500.
Ref: investopedia
Ref: investopedia
Leading and lagging economic indicators
Leading indicators
1. Stock market
2. Manufacturing activity
3. Inventory levels
4. Retail sales
5. Building permits
6. Housing market
7. Level of new business startups
Lagging indicators
1. Change in GDP
2. Income and Wages
3. Unemployed rates
4. Consumer Price Index for Inflation
5. Currency strength
6. Interest rates
7. Corporate profits
8. Balance of trade - trade surplus level
9. Value of Commodity substitutes to US Dollar - against gold and silver
March 14, 2019
Evaluating bank stocks
Ref: Motley Fool youtube. https://www.youtube.com/watch?v=AfT5FaaqNxI&list=PLXIJDn8_-fyEsbjwBto2GzIS1JPq5I2iR&index=8
Objective of banks: Borrow money at a lower interest rate and lend at a higher rate, and make profit from the spread.
3 key metrics:
1. Annual Return of Equity for 10 years. Find the lowest number. If that number is negative, bank had big losses during the 2008 financials crisis. So avoid them. Return of Equity is available in SEC 10k or q filing.
Return of Equity = Annual Income / Shareholder Equity = Annual Income / (Total Assets - Total Liabilities)
Ideally Return of Equity should be greater than 10% and for good banks it should be 15%.
The Return of Equity may be very high some months during good economic conditions if bank underwrite bad loans, which will turn bad later. That's why we need to look many years.
2. Discipline of the bank measured by Efficiency Ratio.
Efficiency Ratio = Operating Expenses / Total Revenue
Typically this ratio will be between 50-60%. If the ratio is greater than 60%, it means the financial discipline of the bank is ideal.
3. Sales Profitability
Sales Profitability => Top-line Revenue or Gross sales / Asset > 4.5%
Objective of banks: Borrow money at a lower interest rate and lend at a higher rate, and make profit from the spread.
3 key metrics:
1. Annual Return of Equity for 10 years. Find the lowest number. If that number is negative, bank had big losses during the 2008 financials crisis. So avoid them. Return of Equity is available in SEC 10k or q filing.
Return of Equity = Annual Income / Shareholder Equity = Annual Income / (Total Assets - Total Liabilities)
Ideally Return of Equity should be greater than 10% and for good banks it should be 15%.
The Return of Equity may be very high some months during good economic conditions if bank underwrite bad loans, which will turn bad later. That's why we need to look many years.
2. Discipline of the bank measured by Efficiency Ratio.
Efficiency Ratio = Operating Expenses / Total Revenue
Typically this ratio will be between 50-60%. If the ratio is greater than 60%, it means the financial discipline of the bank is ideal.
3. Sales Profitability
Sales Profitability => Top-line Revenue or Gross sales / Asset > 4.5%
Shareholder's Equity
Suppose if a company is liquidated today i.e. all assets sold off and liabilities paid off, then the amount of money left for the shareholders is the Shareholder's Equity.
Shareholder's Equity = Total Assets - Total Liabilities
Ref: investopedia
Shareholder's Equity = Total Assets - Total Liabilities
Ref: investopedia
Where to find SEC filings?
It's available on EDGAR (Electronic Data Gathering, Analysis, and Retrieval) website.
Can retired shared be reissued?
No. Whereas Treasury stocks can be.
Authorized vs Issued vs Outstanding shares
Authorized is the number of shared permitted for a company as part of their incorporation. This can increase after the initial formation.
Issued is the subset of the Authorized which is actually sold to investos.
Outstanding is Issued minus Treasury shares. Treasury is shares bought back by the company but not retired.
Issued is the subset of the Authorized which is actually sold to investos.
Outstanding is Issued minus Treasury shares. Treasury is shares bought back by the company but not retired.
Treasury Stock
When a comany buys back its own shares and doesn’t retire them, those shares are called Treasury Stock
Shares Outstanding vs Float
Shares Outstanding is the total amount of shares that exists for a company. Float is is actual amount available for trading after subtracting the restricted shares.
March 13, 2019
Quantitative Easing (QE)
Unconventional intervention by the Central bank to simulate economy by large scale purchase of government assets like bonds and securities. This helps government to introduces large scale money into the economy (or increase money liquidity). The net effect is it lowers interest rate thereby increasing money supply overall.
Law of diminishing returns
In economic, the law of diminishing returns states that the output produced (e.g. materials created, quality of the product etc) increases proportionally to the input (e.g. time put, resources used etc). But beyond a point, called Point of Diminishing Returns, addition of input only leads to decreasing rate of output.
Cyclical stocks
Stocks which are higly correlated to economy. They drop during recession and go up during economic expansion.
Fiat vs Commodity currency
Fiat is a legal tender whose value is backed by a government. Currency whose value is tied to a commodity like gold or silver is commodity money. US dollar is a fiat currency.
S&P Sector performance for past 1 year
Recorded on Mar 13, 2019
S&P average: +0.31%
Ref: http://www.sectorspdr.com/sectorspdr/tools/sector-tracker
S&P average: +0.31%
Ref: http://www.sectorspdr.com/sectorspdr/tools/sector-tracker
S&P Sector performance for past 5 years
Recorded on Mar 13, 2019
S&P average: +49.42%
Ref: http://www.sectorspdr.com/sectorspdr/tools/sector-tracker
S&P average: +49.42%
Ref: http://www.sectorspdr.com/sectorspdr/tools/sector-tracker
March 11, 2019
GAAP earnings
GAAP stands for Generally Accepted Accounting Principles. GAAP provides accounting uniformity by which businesses report financial performance. Example: When a company performs an expensive restructuring or an asset writedown that impacts profits, that much be reported under GAAP earnings. In addition, the company will also issue an non-GAAP or adjusted or pro forma earnings that exclude such one-time non-recurring items.
Ref: Businesss Insider
Ref: Businesss Insider
January 14, 2019
Subscribe to:
Posts (Atom)