Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
I am having the data like below
year/week sales
48.2017,10
49.2017,20
50.2017,30
10.2018,40
42.2018,50
based on above data how to get the max year week?
Thanks in advance.
Try like:
Firstsortedvalue([year/week], -(Subfield([year/week ], '.', 2)*100+ Subfield([year/week ], '.', 1))
May be this:
Data:
LOAD * INLINE [
year/week, sales
48.2017,10
49.2017,20
50.2017,30
10.2018,40
42.2018,50
];
MaxWeekYear:
LOAD Max(SubField([year/week], '.', 2)) AS MaxYear
Resident Data;
INNER JOIN (MaxWeekYear)
LOAD SubField([year/week], '.', 2) AS MaxYear,
Max(SubField([year/week], '.', 1)) AS MaxWeek
Resident Data
Group By SubField([year/week], '.', 2);
Firstsortedvalue(Aggr(Sum(sales), [year/week]), -(Subfield([year/week ], '.', 2)*100+ Subfield([year/week ], '.', 1))