Knowledge Base

Using Header Notation in Quintessence

In Quintessence, several functions support header notation, allowing you to reference columns by their header names rather than their positional index. This improves readability, reduces errors, and ensures formulas remain robust even when column order changes.


Functions That Support Header Notation

The following functions are compatible with header notation:


Purpose of Header Notation

Header notation serves two important goals:

    • Preserving original headers
      When no calculations are applied, Quintessence retains the original data headers.
      (The Pivot function is the only exception, as it does not return the original headers.)
    • Reliable column access
      Because datasets may vary in structure or column order, referencing columns by name ensures that formulas always use the correct field – regardless of position.

    How Calculated Columns Are Named

    When calculations are applied using header notation, Quintessence assigns names like Header n to new output columns, where n refers to the position of that column in the result.

    For example, given the data in cells A1:B4:

    StockPrice
    AAA100
    BBB200
    DDD400

    The formula:

    =Qx.Transform(A1:B4, "[Stock], 'Stock: ' + [Stock], [Price], [Price] + 1")

    Produces the following output:

    StockHeader 2PriceHeader 4
    AAAStock: AAA100101
    BBBStock: BBB200201
    DDDStock: DDD400401

    Renaming Output Headers

    You can rename generated headers using the as keyword. For example, to:

    • Replace Header 2 with Stock and drop the original Stock column
    • Rename Price to OldPrice
    • Rename Header 4 to NewPrice

    You can use:

    =Qx.Transform(A1:B4, "'Stock: ' + [Stock] as [Stock], [Price] as [OldPrice], [Price] + 1 as [NewPrice]")

    Which produces:

    StockOldPriceNewPrice
    Stock: AAA100101
    Stock: BBB200201
    Stock: DDD400401

    Conclusion

    Header notation is a powerful feature in Quintessence that makes formulas more intuitive, flexible, and resilient. By referencing columns by name rather than by position, you avoid issues caused by structural changes in your data and maintain clarity in your transformations. Combined with the ability to rename output columns, header notation helps ensure that your results remain well‑structured, readable, and aligned with your analytical goals.