Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 dafnis14
		
			dafnis14
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 sasiparupudi1
		
			sasiparupudi1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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;
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Is your Month field like Jan, Feb, Mar by any chance?
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 dafnis14
		
			dafnis14
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I attached a QVW...it's a number
 dafnis14
		
			dafnis14
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks, but it still doesn't work.
I attached the QVW with the data
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Can you try this
MakeDate(2018,MonthNum*1,1) as Target_MonthStartDate
or this
MakeDate(2018,Num#(MonthNum),1) as Target_MonthStartDate
 dafnis14
		
			dafnis14
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You were right!
num# solved it. Thanks!
