
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Issue with MakeDate
Hi,
I'm trying to create a date with MakeDate function in a LOAD, but somehow I get null values.
The data:
TargetName | Target_Dim | Month | Target | Target_MonthStartDate |
XXX | 10 | 1 | 10 | |
XXX | 10 | 2 | 10 | |
XXX | 10 | 3 | 10 | |
XXX | 10 | 4 | 10 | |
XXX | 12 | 1 | 10 | |
XXX | 12 | 2 | 10 | |
XXX | 12 | 3 | 10 | |
XXX | 12 | 4 | 10 | |
XXX | 14 | 1 | 10 | |
XXX | 14 | 2 | 10 | |
XXX | 14 | 3 | 10 |
The script:
Temp_Targets:
LOAD Target_Dim,
TargetName,
Month,
Target,
MakeDate(2018,Month,1) as Target_MonthStartDate
FROM
$(vPathTempData)Temp_Targets.qvd
(qvd);
What is the reason?
Thanks!
Message was edited by: Dafnis X attached QVW
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the only reason is that Month isn't numeric - you could check it with num() or isnum() and maybe adjusting it with num#() or trim() or keepchar() and similar.
- Marcus


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It works normally for me...Make sure that you are selecting the field from the temp table
T1:
Load * Inline
[
TargetName,Target_Dim,Month,Target, XX
XXX,10,1,10,
XXX,10,2,10,
XXX,10,3,10,
XXX,10,4,10,
XXX,12,1,10,
XXX,12,2,10,
XXX,12,3,10,
XXX,12,4,10,
XXX,14,1,10,
XXX,14,2,10,
XXX,14,3,10
];
Temp_Targets:
NoConcatenate LOAD Target_Dim,
TargetName,
Month,
Target,
MakeDate(2018,Month,1) as Target_MonthStartDate
Resident T1;
Drop table T1;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is your Month field like Jan, Feb, Mar by any chance?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the only reason is that Month isn't numeric - you could check it with num() or isnum() and maybe adjusting it with num#() or trim() or keepchar() and similar.
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I attached a QVW...it's a number

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, but it still doesn't work.
I attached the QVW with the data

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you try this
MakeDate(2018,MonthNum*1,1) as Target_MonthStartDate
or this
MakeDate(2018,Num#(MonthNum),1) as Target_MonthStartDate

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You were right!
num# solved it. Thanks!
