Creating Text Columns For Data Analysis Slides
Creating Text Columns For Data Analysis Slides
Analysis
Andrew McSwiggan
BUSINESS INTELLIGENCE SPECIALIST
Use a series of text manipulation
functions
Overview How to search through text strings to
extract specific values
Split the product description into
multiple columns
A firm foundation for product analysis
Add custom columns to your dimension
tables
Creating Columns
Analysis Requirements
Color Size
Add Columns
Save the new attributes and values in the product dimension table
Lists of values
Creating Product Attributes
Save the new attributes and values in the product dimension table
Product descriptions
Look at the Data
How is it delimited?
Spaces!
Create a new description column
- Change the spaces
- To another value
- Not in the data
- Easy to see
Replace a String with SUBSTITUTE
SUBSTITUTE(
<column_name>,
<old_text>,
<new_text>
<instance_num> )
SUBSTITUTE
Column Name of the column (or text string)
<Product_Description>,
<“ “> ,
<“&”> ,
<1> )
Data Model
Row Context
Autumn Winter
Autumn&Winter
Spring Summer
Spring&Summer
Create Column
SUBSTITUTE(
<SUBSTITUTE([Product_Description]," ","&",1)>,
<“ “> ,
<“-”> ,
<> )
Identify Text Positions with SEARCH & FIND
Locate the Position
FIND SEARCH
Case sensitive Not case sensitive
SEARCH(
“-”,
[Product Base],
1 ,
-1 )
14 22 30 35
Cut Out Text Parts with LEFT MID & RIGHT
Function Collection
14 22 30 35
New Columns
Color Size
LEFT (
[Product Base]
, [Season Gap] -1 )
, [Product Base]
, [Season Gap] +1
Start Num The position in the middle of the string to start from
, [Product Base]
SUBSTITUTE
Light Green
LightGreen
Capitalising Text with UPPER & REPLACE
Product
Title or - Lower case
Relevant
Other Attributes
Graphic - First letter is Capital
CAPITALISE
UPPER ( <column> )
Lookup
Cutout Text
- LEFT
- MID
- RIGHT
Lookup Values
- RELATED
- RELATEDTABLE
Join Text Strings with COMBINEVALUES
Combine Text Strings
RELATED RELATEDTABLE
Single value Table of values
RELATED ( <table name column name> )
RELATED
Sale Count
Multi Sale
SUMX(
, <Column Name> )
RELATEDTABLE