G0165 error in data cleaning example on Aptech site

Hello all, when I run the code shown in the data cleaning exercise on the Aptech website I get the G0165 error at this stage:

email_database = territory_info[., "KAR" "Store Name"] ~ email_address ~ nielsen;

it says

G0165 : Type mismatch or missing arguments

 

Please advise.

1 Answer



0



Thank you for this question. This error has been fixed in the blog. However, it still might be useful to review why this was occurring.

First, let's put some context to your question. The line of code you provided occurred after the section of code below:

/*
** Create email addresses
*/
// Convert store number to string
str_store = itos(territory_info[., "Store"]);

// Add prefix
email_address = str_store $+ "[email protected]";

// Convert to dataframe
// and name the variable "Email"
email_df = asDF(email_address, "Email");

Note that in this section of the code, we store the created email addresses in GAUSS in two different places:

  1. A string array called email_address.
  2. A dataframe called email_df.

The original code that was generating the error was attempting to concatenate the string array, email_address, to existing dataframes:

// Form dataframe containing
// email list information
email_database = territory_info[., "KAR" "Store Name"] ~ email_address ~ nielsen;

This is not allowed and was generating a G0165 : Type mismatch or missing arguments error.

The correct way to build the email database is to concatenate the dataframe, email_df with the other existing dataframes:

// Form dataframe containing
// email list information
email_database = territory_info[., "KAR" "Store Name"] ~ email_df ~ nielsen;

Eric

105

Your Answer

1 Answer

0

Thank you for this question. This error has been fixed in the blog. However, it still might be useful to review why this was occurring.

First, let's put some context to your question. The line of code you provided occurred after the section of code below:

/*
** Create email addresses
*/
// Convert store number to string
str_store = itos(territory_info[., "Store"]);

// Add prefix
email_address = str_store $+ "[email protected]";

// Convert to dataframe
// and name the variable "Email"
email_df = asDF(email_address, "Email");

Note that in this section of the code, we store the created email addresses in GAUSS in two different places:

  1. A string array called email_address.
  2. A dataframe called email_df.

The original code that was generating the error was attempting to concatenate the string array, email_address, to existing dataframes:

// Form dataframe containing
// email list information
email_database = territory_info[., "KAR" "Store Name"] ~ email_address ~ nielsen;

This is not allowed and was generating a G0165 : Type mismatch or missing arguments error.

The correct way to build the email database is to concatenate the dataframe, email_df with the other existing dataframes:

// Form dataframe containing
// email list information
email_database = territory_info[., "KAR" "Store Name"] ~ email_df ~ nielsen;


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy