Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do i write set analysis??

Hi All,

for example this is my data.

     item   Date             ord_no        Rate

     123     2011-jan-17        1             22

     123     2011-mar-18       2             12

     145     2011-feb-19        3             30

     145     2011-mar-20       4            13

     165     2011-jan-30        5             15

     165     2011-mar-01       6            17

     165     2011-mar-31        7           255

if i select financial year like 2011-2012 i need last year means upto 31-3-11 max ord_no corresponding rate.

item wise.

My result like this i need:

item         rate

123          12

145           13

165            255

Thanks,

Ashok.

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Then use set analysis in that function

=FirstSortedValue({<YearField={$(=Max(YearField)-1)}>} Rate, -OrdNo)

View solution in original post

9 Replies
sujeetsingh
Master III
Master III

Just go with following link and it will help you to set analysis...

http://community.qlik.com/servlet/JiveServlet/previewBody/1867-102-1-1858/QlikLearn-Set-Analysis-Pre...

jagan
Luminary Alumni
Luminary Alumni

Hi Ashok,

Hope attached file helps you. 

Regards,

Jagan.

CELAMBARASAN
Partner - Champion
Partner - Champion

First Sorted value help you here.

Item as dimension

=FirstSortedValue(Rate, -OrdNo)

Hope it helps

Not applicable
Author

Hi,

      that function is working for current year but i need last year max date rate.

Not applicable
Author

er_mohit
Master II
Master II

-FirstSortedValue(OrdNo,-Rate)

hope it helps you

CELAMBARASAN
Partner - Champion
Partner - Champion

Then use set analysis in that function

=FirstSortedValue({<YearField={$(=Max(YearField)-1)}>} Rate, -OrdNo)

Not applicable
Author

Hi,

    but it's giving all zero's.

Not applicable
Author

Hi,

   Thanks,it's working perfectly.