Lesson 3: Rename Columns

 

Applies To: SQL Server 2016

In this lesson, you will rename many of the columns in each table you imported. Renaming makes columns more identifiable and easier to navigate in both the model designer as well by users selecting fields in a client application. To learn more, see Rename a Table or Column (SSAS Tabular).

System_CAPS_ICON_important.jpg Important


Renaming columns is not necessary to complete this tutorial; however, remaining lessons, in particular those that include creating relationships and creating calculated columns and measures using DAX formulas, refer to the column friendly names described in this lesson. If you choose not to rename columns, you will have to edit the DAX formulas in lessons 5, 6, and 7 to use the original source column names provided in this lesson.

Estimated time to complete this lesson: 20 minutes

This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks in this lesson, you should have completed the previous lesson: Lesson 2: Add Data.

To rename columns

  1. In the model designer, click the Customer table (tab).

    When you click a tab, that table becomes active in the model designer window.

  2. Double click the CustomerKey column name, then type Customer Id, and then press ENTER.

    System_CAPS_ICON_tip.jpg Tip


    You can also rename a column in the Column Name property in the column’s Properties window, or in Diagram View.

  3. Rename the remaining columns in the Customer table, as well as the columns in the remaining tables, replacing the source name with the friendly name:

    Customer Table

    Source NameFriendly Name
    GeographyKeyGeography Id
    CustomerAlternateKeyCustomer Alternate Id
    FirstNameFirst Name
    MiddleNameMiddle Name
    LastNameLast Name
    NameStyleName Style
    BirthDateBirth Date
    MaritalStatusMarital Status
    EmailAddressEmail Address
    YearlyIncomeYearly Income
    TotalChildrenTotal Children
    NumberChildrenAtHomeNumber of Children At Home
    EnglishEducationEducation
    EnglishOccupationOccupation
    HouseOwnerFlagOwns House
    NumberCarsOwnedNumber of Cars Owned
    AddressLine1Address Line 1
    AddressLine2Address Line 2
    PhonePhone Number
    DateFirstPurchaseDate of First Purchase
    CommuteDistanceCommute Distance

    Date

    Source NameFriendly Name
    FullDateAlternateKeyDate
    DayNumberOfWeekDay Number of Week
    EnglishDayNameOfWeekDay Name
    DayNumberOfMonthDay of Month
    DayNumberOfYearDay of Year
    WeekNumberOfYearWeek Number of Year
    EnglishMonthNameMonth Name
    MonthNumberOfYearMonth
    CalendarQuarterCalendar Quarter
    CalendarYearCalendar Year
    CalendarSemesterCalendar Semester
    FiscalQuarterFiscal Quarter
    FiscalYearFiscal Year
    FiscalSemesterFiscal Semester

    Geography

    Source NameFriendly Name
    GeographyKeyGeography Id
    StateProvinceCodeState Province Code
    StateProvinceNameState Province Name
    CountryRegionCodeCountry Region Code
    EnglishCountryRegionNameCountry Region Name
    PostalCodePostal Code
    SalesTerritoryKeySales Territory Id

    Product

    Source NameFriendly Name
    ProductKeyProduct Id
    ProductAlternateKeyProduct Alternate Id
    ProductSubcategoryKeyProduct Subcategory Id
    WeightUnitMeasureCodeWeight Unit Code
    SizeUnitMeasureCodeSize Unit Code
    EnglishProductNameProduct Name
    StandardCostStandard Cost
    FinishedGoodsFlagIs Finished Product
    SafetyStockLevelSafety Stock Level
    ReorderPointReorder Point
    ListPriceList Price
    SizeRangeSize Range
    DaysToManufactureDays to Manufacture
    ProductLineProduct Line
    Dealer PriceDealer Price
    ModelNameModel Name
    LargePhotoLarge Photo
    EnglishDescriptionDescription
    StartDateProduct Start Date
    EndDateProduct End Date
    StatusProduct Status

    Product Category

    Source NameFriendly Name
    ProductCategoryKeyProduct Category Id
    ProductCategoryAlternateKeyProduct Category Alternate Id
    EnglishProductCategoryNameProduct Category Name

    Product Subcategory

    Source NameFriendly Name
    ProductSubcategoryKeyProduct Subcategory Id
    ProductSubcategoryAlternateKeyProduct Subcategory Alternate Id
    EnglishProductSubcategoryNameProduct Subcategory Name
    ProductCategoryKeyProduct Category Id

    Internet Sales

    Source NameFriendly Name
    ProductKeyProduct Id
    CustomerKeyCustomer Id
    PromotionKeyPromotion Id
    CurrencyKeyCurrency Id
    SalesTerritoryKeySales Territory Id
    SalesOrderNumberSales Order Number
    SalesOrderLineNumberSales Order Line Number
    RevisionNumberRevision Number
    OrderQuantityOrder Quantity
    UnitPriceUnit Price
    ExtendedAmountExtended Amount
    UnitPriceDiscountPctUnit Price Discount Pct
    DiscountAmountDiscount Amount
    ProductStandardCostProduct Standard Cost
    TotalProductCostTotal Product Cost
    SalesAmountSales Amount
    TaxAmtTax Amt
    CarrierTrackingNumberCarrier Tracking Number
    CustomerPONumberCustomer PO Number
    OrderDateOrder Date
    DueDateDue Date
    ShipDateShip Date

To continue this tutorial, go to the next lesson: Lesson 4: Mark as Date Table.

Community Additions

ADD
Show: