Main Content

aggregation

Set Haver Analytics aggregation mode

    Description

    x = aggregation(c) returns the current aggregation mode, where c is either a haver or haverdirect connection object.

    • x = 0 indicates that the aggregation mode is set to keep missing data without filling it.

    • x = 1 indicates that the aggregation mode is set to fill missing data based on data available in the requested period.

    • x = 2 indicates that the aggregation mode is set to fill missing data according to some past value.

    • x = -1 indicates that the aggregation mode is set to reset to its last valid setting.

    example

    x = aggregation(c,aggmode) sets the aggregation mode for handling missing data.

    Examples

    collapse all

    Create a DLX Direct connection for the Haver Analytics®database that you want to connect to. In this example, replace USECON with the name of your database.

    databasename = "USECON";
    c = haverdirect(databasename)
    
    c = 
    
      haverdirect with properties:
    
            DatabaseName: "USECON"
            DatetimeType: ''
        DataReturnFormat: ''

    To keep missing data without filling it, set the aggregation mode to 1.

    aggmode = 1;
    x = aggregation(c,aggmode)
    
    x =
    
          1.00
    

    Input Arguments

    collapse all

    Haver Analytics connection, specified as a haver or haverdirect connection object.

    Aggregation mode, specified as one of the following options:

    • 0 — Keep missing data without filling it.

    • 1 — Fill missing data based on data available in the requested period.

    • 2 — Fill missing data based on some past value.

    • -1 — Reset mode to its last valid setting.

    Version History

    Introduced in R2008b