Tableau / Basic: fields, models and views / Lesson 2
Types, roles and discrete/continuous fields
Distinguish a field’s stored meaning, analytical role and view representation without equating every number with a measure or every dimension with blue.
On this page
Lesson goals
- Separate data type from dimension/measure role.
- Explain discrete headers and continuous axes.
- Preserve identifiers, dates and numeric precision.
Separate three field decisions
A field has a data type, an analytical role and a discrete or continuous representation. These are related decisions, not synonyms. An integer product code can be a dimension because it identifies categories, while a numeric amount is often a measure to aggregate. Dates can be dimensions and appear continuously. Tableau’s blue and green cues describe discrete and continuous behavior rather than a universal dimension/measure split. Inspect the field’s meaning and use in the view instead of trusting automatic assignment. A convenient default can still answer the wrong analytical question.
Read headers and axes
A discrete field placed on Rows or Columns generally creates headers for distinct members, while a continuous field creates an axis. The first record contrasts product categories with a continuous sales axis. Converting a field can change layout and interpretation without changing its underlying source values. A discrete numeric code should not become a meaningful sum merely because Tableau recognizes digits. Conversely, making a measure discrete does not automatically make it a descriptive business dimension. Review aggregation, sorting and labels after the representation changes, and explain why the chosen view supports the reader’s task.
Product: dimension, discrete -> category headers
SUM(Sales): measure, continuous -> numeric axis
Order Date: dimension; discrete or continuous depending on the question
Product Code: identifier; summation is not its business meaning
This is conceptual text and not a worksheet configuration executed in Tableau.
Protect identifiers and locale
An identifier 0017 may need to remain text because leading zeros distinguish its source representation. Formatting 17 with four digits cannot reliably recover information already discarded. Ambiguous text dates and decimal separators also need explicit locale/source rules. A date display can hide a time component that still matters to grouping or joining. Keep a small schema contract naming type, null policy and accepted format. The second program compares text identity with integer conversion without reading any source. It demonstrates destructive conversion only, not Tableau parsing or a recommended normalization rule.
code = "0017"
converted = int(code)
print(code)
print(converted)
print(code == str(converted))
0017
17
False
0017 and 17 no longer have the same string identity. No workbook type inference is tested.
Choose null and numeric meaning
A null can represent missing, unknown or not applicable; zero is a real numeric observation. Converting every null to zero can make a view look complete while understating averages or creating false activity. Numeric precision and rounding also belong to the metric contract rather than the axis format alone. Decide whether rounding occurs per line or after aggregation and retain an exact small expected total. If a field is a count, percentage or rate, state its unit and denominator. The same source number can be displayed plausibly in several formats that carry very different meanings.
Review the resulting view contract
Test a text identifier, a typed date, a no-data case and a measure shown both as discrete and continuous when that comparison is meaningful. Confirm whether the view creates the intended headers, axes and aggregation. This course changes no field role and opens no GUI. Its Python conversion establishes a string/integer distinction only. Actual connector typing, locale behavior and worksheet layout require separately authorized Tableau validation. A clear field inventory records all three decisions so another author can reproduce the analytical intent without memorizing a color convention or assuming every automatically recognized number should be summed.
Common errors and fixes
Every green field is called a measure
- Why it happens
- Continuous representation was confused with analytical role.
- How to fix it
- Inspect type, role and representation separately.
- Prevent it next time
- Keep a continuous-date dimension example in review.
Product codes are summed as business amounts
- Why it happens
- Numeric type inference replaced identifier meaning.
- How to fix it
- Preserve the documented identifier role and source representation.
- Prevent it next time
- Specify schema meaning before building shelves.
Nulls become zero without an analytical decision
- Why it happens
- Visual completeness replaced missing-data semantics.
- How to fix it
- Define missing versus actual-zero behavior before conversion.
- Prevent it next time
- Test count, average and no-data results separately.
Check your understanding
1. Why can a date be a dimension and still create a continuous axis?
Show worked solution
Dimension describes its grouping/segmentation role, while continuous describes representation. A date dimension can therefore be continuous, producing a temporal axis rather than discrete headers. Verify the selected date level and interpretation instead of inferring role from green alone. The source data type remains another distinct decision.
2. Why should a code 0017 not be reconstructed from 17 by display formatting?
Show worked solution
Conversion can collapse distinct source strings into one integer, and an assumed width may be wrong. Formatting changes presentation only. Preserve original text and define any normalization explicitly, keeping identifiers separate from numeric measures even when both contain digits.
Key takeaways
- Type, analytical role and discrete/continuous representation are separate choices.
- Identifier and missing-data meaning must survive preparation and display.