Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 sandeepbijoor
		
			sandeepbijoor
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if(match(Timesheet_Weekno,Max(Timesheet_Weekno)),[Project Manager Name]) as MaxWeekProjectManagerName
Why this expression is giving error ? Please help me
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can left join the MaxTimesheet_Weekno field while getting Max Timesheet_Weekno and then use this field for calcualtion.
Left Join(Source)
Load
Max(Timesheet_Weekno) a MaxTimesheet_Weekno
Resident Source;
Load *, 
if(match(Timesheet_Weekno,MaxTimesheet_Weekno),[Project Manager Name]) as MaxWeekProjectManagerName
From Source;
Drop Table Source;
Are you doing this in Expression or Script?
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You are using aggregation function max(), that would require group by clause in the script when used with more fields in the load. Try like:
Load
Field1,
Field2
<your statement>
From <> group by Field1, Field2...;
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		In your expression you are using Max() which is require Group By statements and grouping on the dimension, so you can't use with out using Group By clause in your statement.
Try
Load
Fields1,
Fields2,
if(match(Timesheet_Weekno,Max(Timesheet_Weekno)),[Project Manager Name]) as MaxWeekProjectManagerName
From Source
Group By
Timesheet_Weekno,
[Project Manager Name],
Fields,,,,,;
Please read about the Aggr or Group By.
 
					
				
		
 sushil353
		
			sushil353
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Create your max function is some variable
LET vMaxMonth = Max(Timesheet_Weekno);
if(match(Timesheet_Weekno,'$(vMaxMonth )'),[Project Manager Name]) as MaxWeekProjectManagerName
HTH
Sushil
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can left join the MaxTimesheet_Weekno field while getting Max Timesheet_Weekno and then use this field for calcualtion.
Left Join(Source)
Load
Max(Timesheet_Weekno) a MaxTimesheet_Weekno
Resident Source;
Load *, 
if(match(Timesheet_Weekno,MaxTimesheet_Weekno),[Project Manager Name]) as MaxWeekProjectManagerName
From Source;
Drop Table Source;
 sandeepbijoor
		
			sandeepbijoor
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you everyone for help. Problem got solved by group by
 
					
				
		
 oknotsen
		
			oknotsen
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post; not visible in preview) and Helpful Answers (found under the Actions menu under every post).
If not, please make clear what part of this topic you still need help with  .
.
