Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
if(match(Timesheet_Weekno,Max(Timesheet_Weekno)),[Project Manager Name]) as MaxWeekProjectManagerName
Why this expression is giving error ? Please help me
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?
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...;
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.
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
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;
Thank you everyone for help. Problem got solved by group by
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 .