Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
prajapatiamar38
Creator II
Creator II

YTD & LYTD?

Hi experts..,

i want to find out max and max(,2) for ytd and lytd from the follwing field

MOP_FY

F10

F11

F12

F13

F14

F15

F16

When i use max(MOP_FY) It gives NULL output because of that F in field value...

i want to find out max value= F16

second max value=F15
PLZ HELP ME...

7 Replies
tresesco
MVP
MVP

FirstSortedValue(MOP_FY, -Purgechar(MOP_FY,'F'))

FirstSortedValue(MOP_FY, -Purgechar(MOP_FY,'F') , 2)

prajapatiamar38
Creator II
Creator II
Author

hie,

i had check ur expression..i had try it in text object..it give null output..
not working.

tresesco
MVP
MVP

Working with me. PFA

prajapatiamar38
Creator II
Creator II
Author

hie..
sorry but i had copy the same expression in my application..
it gives null value...
is there any other way...?

i had try maxstring function..
maxstring(mop_fy) i got F16
but for  F15 what to do?

tresesco
MVP
MVP

Best way - share your sample qvw.

prajapatiamar38
Creator II
Creator II
Author

hie,

sorry my qvw is large in size.
not able to send...

plz help me other way...

and ur qvw gives error on selection,,
jst chk it

tresesco
MVP
MVP

Check Preparing examples for Upload - Reduction and Data Scrambling

Amarnath Prajapati wrote:

....

and ur qvw gives error on selection,,
jst chk it

If you select one value, you would get output for the first (max) expression and there is no second value in the scope , so no output for second max value. Hope, that makes sense. I.e. you have to select at least two values to make both the expressions work.

If your field values have unwanted blanks, you might try something like:

FirstSortedValue(MOP_FY, -Num(Purgechar(MOP_FY,'F')))

FirstSortedValue(MOP_FY, -Num(Purgechar(MOP_FY,'F')) , 2)