Discussion Board for collaboration on QlikView Scripting.
I have a strange issue with date column.
I am able to convert date column into MM/DD/YYYY in my local machine, but I was not able do in remote desktop and it is showing null values.
I used num(date) in script.
Iam able to convert my own format using Left(date,10), but not able to convert DD/MM/YYYY format.
Is there settings to apply for remote desktop version
Please guide me how to achive this thing
Please post your script,
if you declare functions explicitly it should work, like
DATE(DATE#(MyDate, 'MM/DD/YYYY'), 'DD/MM/YYYY') AS MyConvertedDate
I tried it but it didn't work out and i am pasting the script below.
LOAD visitor_key as site_visit_visitor_key ,
visitor_source_system_id_nk as [Visitor Source System ID nk],
visitor_id as [Visitor ID],
visitor_rackuid as [Visitor RackUID] ,
visitor_source_system_name as [Visitor Source System Name],
visitor_source_system_column as [Visitor Source System Column]
LOAD time_key as site_visit_start_datetime_key ,
time_full_date as [Time Full Date],
time_day_number as [Time Day Number],
time_day_of_week as [Time Day Of Week],
time_month_number as [Time Month Number],
time_month_desc as [Time Month Desc],
time_month_abbr as [Time Month Abbr],
time_year_number as [Time Year Number],
time_quarter_number as [Time Quarter Number],
time_quarter_desc as [Time Quarter Desc],
time_business_day_number as [Time Business Day Number],
time_year_month_key as [Time Year Month Key],
time_last_day_month_flag as [Time Last Day Month Flag],
time_rec_added as [Time Rec Added],
time_rec_updated as [Time Rec Updated],
time_current_record as [Time Current Record],
time_week_year_number as [Time Week Year Number],
time_week_month_number as [Time Week Month Number],
time_day_yr as [Time Day Year],
time_day_week as [Time Day Week]
num(max([Time Full Date])) as nummaxdate,
max([Time Full Date]) as maxdate
LOAD site_visit_start_datetime_key ,
[Time Full Date],
[Time Day Number],
[Time Day Of Week],
[Time Month Number],
[Time Month Desc],
[Time Month Abbr],
[Time Year Number],
[Time Quarter Number],
[Time Quarter Desc],
[Time Business Day Number],
[Time Year Month Key],
[Time Last Day Month Flag],
[Time Rec Added],
[Time Rec Updated],
[Time Current Record],
[Time Week Year Number],
[Time Week Month Number],
[Time Day Year],
[Time Day Week],
MOD(($(x)-num([Time Full Date])),7) as y,
Day([Time Full Date]) as z
DAY([Time Full Date]) as dayofmonth
DROP TABLE Dim_time_temp;
Try to use Date() and Date#() like below
Date(Date#(DateFieldName, 'Source Data Format'), 'Required Date format')
Date(Date#(DateFieldName, 'DD/MM/YYYY'), 'MM/DD/YYYY')
Use above script if you are converting 'DD/MM/YYYY' to 'MM/DD/YYYY'.
Hope this helps you.
Peter and Jagan's suggestions should work for you.
The reason it works on you PC and not the the remote desktop could be the locale of the server and if its using UK/US or other date formatting.
For example at the start of all QV scripts will be the default formatting rules, my PC is UK so the default date format is
Actually I am new to qlikview. my remote box is US and already some default values are there like below
SET TimeFormat='h:mm:ss TT';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
In QVD the date column [Time Full date] format is like YYYY-MM-DD, but I want like MM/DD/YYYY.
Can you help me, how to resolve this issue.
did you try
date([Time Full Date],'MM/DD/YYYY')
date(date#([Time Full Date],'YYYY-MM-DD'),'MM/DD/YYYY'
Try with this.....
SET DateFormat='M/D/YYYY'; change to SET DateFormat='MM/DD/YYYY';
I tried with 2 options, but no use.
Do we need to any settings for this one.
Try like this.....
Date(Date#('8/4/12', 'M/D/YY'), 'MM/DD/YY') as dateField
Output is 08/04/12