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: 
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.

Labels (1)
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
Partner - Champion III
Partner - Champion III

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.