Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to insert another field as Month and it should contain only month names based on dates given in Date of Sales field. And this [Date of Sales] filed in MM/DD/YYYY format.
How to insert this field. Please any one help me.
[Case Study 3]:
LOAD Customer_id as [Customer ID],
Customer_name as [Customer Name],
Subsegment,
City,
Division,
Category,
Version,
Sales_amount as [Sales],
No_of_Licences as [Licenses],
Sales_Date as [Date of Sales]
FROM
Sales1.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
For date of sale try this
Date(Date#(Sales_Date,'MM/DD/YYYY'),'MM/DD/YYYY') as [Date of Sales],
[Case Study 3]:
LOAD Customer_id as [Customer ID],
Customer_name as [Customer Name],
Subsegment,
City,
Division,
Category,
Version,
Sales_amount as [Sales],
No_of_Licences as [Licenses],
Date(Date#(Sales_Date,'MM/DD/YYYY'),'MM/DD/YYYY') as [Date of Sales],
Month(Sales_Date) as [Sales Month] //Check this
FROM
Sales1.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
[Case Study 3]:
LOAD Customer_id as [Customer ID],
Customer_name as [Customer Name],
Subsegment,
City,
Division,
Category,
Version,
Sales_amount as [Sales],
No_of_Licences as [Licenses],
Sales_Date as [Date of Sales],
month(Sales_Date) as month
FROM
Sales1.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Updated new script check now
Load your table like and add the MM/DD/YYYY format for date field
[Case Study 3]:
LOAD Customer_id as [Customer ID],
Customer_name as [Customer Name],
Subsegment,
City,
Division,
Category,
Version,
Sales_amount as [Sales],
No_of_Licences as [Licenses],
Sales_Date as [Date of Sales],
Monthname(Sales_Date) as MonthName, //Check this
Month(Sales_Date) as [Sales Month] //Check this
FROM
Sales1.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
[Case Study 3]:
LOAD Customer_id as [Customer ID],
Customer_name as [Customer Name],
Subsegment,
City,
Division,
Category,
Version,
Sales_amount as [Sales],
No_of_Licences as [Licenses],
Sales_Date as [Date of Sales],
Date( Sales_Date,'MMM') as SaleMonth
FROM
Sales1.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
You can simply add below line in your script...
Month(YourDateField) as Month
But better to create a master calendar..
thanks for ur replies, its not working... for better understanding i m attaching the date list box. I just want to add another list box with months name according to given dates.
please help and thanks in advance
Please check your date is not in date format it is text format thats why you are not able to get Months.
Try to connect it with any master calender. Otherwise please provide sample app.
Hi Sandeep
Simply use
Month('Date') as Month,
Ex: Month('02/28/2014') as Month,
You will get FEB as Output.
Regards
Kushal Thakral
For date of sale try this
Date(Date#(Sales_Date,'MM/DD/YYYY'),'MM/DD/YYYY') as [Date of Sales],
[Case Study 3]:
LOAD Customer_id as [Customer ID],
Customer_name as [Customer Name],
Subsegment,
City,
Division,
Category,
Version,
Sales_amount as [Sales],
No_of_Licences as [Licenses],
Date(Date#(Sales_Date,'MM/DD/YYYY'),'MM/DD/YYYY') as [Date of Sales],
Month(Sales_Date) as [Sales Month] //Check this
FROM
Sales1.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
pls put the screen shot after loading it as
date(Sales_Date) as date_of_sales.
It the data is left aligned it is text, if it is right aligned it is numeric which is data.
-Sundar