Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ksk278074
Contributor III
Contributor III

finding current week

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.

Labels (1)
4 Replies
tresesco
MVP
MVP

Try like:

Firstsortedvalue([year/week], -(Subfield([year/week ], '.', 2)*100+ Subfield([year/week ], '.', 1))
ksk278074
Contributor III
Contributor III
Author

Thanks for the repy

HOw to get the sales for the max year week ?

for the aove exp i got max week now i want to sales for the max week

Thanks
rahulpawarb
Specialist III
Specialist III

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);

tresesco
MVP
MVP

Firstsortedvalue(Aggr(Sum(sales), [year/week]), 
-(Subfield([year/week ], '.', 2)*100+ Subfield([year/week ], '.', 1))