Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Congratulations to the new Qlik Luminary and Partner Ambassador class! Meet them here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a new variable in load statement?

Hi All,

It might be something obvious but I am certainly not aware.

I have different tables for Jan and Feb month data. However it does not have a variable to distinguish it as Jan or Feb.

I try to create a new variable (ex below) but it did not work? Please suggest as this is something urgent.

LOAD ID,
"SALES_QTY",
PROD_NAME,
2008 AS YEAR,
1 AS MONTH

SQL SELECT *
FROM db1."mytable";

Thanks in advance for your any help!

Labels (1)
1 Solution

Accepted Solutions
Miguel_Angel_Baeyens
Support
Support

Hello,

Just check the missed semicolon before SQL SELECT statement:


arch25 wrote:
LOAD ID,
"SALES_QTY",
PROD_NAME,
2008 AS YEAR,
1 AS MONTH;

SQL SELECT *
FROM db1."mytable";


View solution in original post

4 Replies
Miguel_Angel_Baeyens
Support
Support

Hello,

Just check the missed semicolon before SQL SELECT statement:


arch25 wrote:
LOAD ID,
"SALES_QTY",
PROD_NAME,
2008 AS YEAR,
1 AS MONTH;

SQL SELECT *
FROM db1."mytable";


Not applicable
Author

Hi, thanks but I have added that. it still does not work

Miguel_Angel_Baeyens
Support
Support

Hi,

What error is that returning? Syntax looks fine.

Not applicable
Author

What are your settings for Months?

What if you try Month('1') As Month instead of just 1 As Month?