Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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 (2)
4 Replies
tresB
Champion III
Champion III

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

tresB
Champion III
Champion III

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