Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
santharubban
Creator III
Creator III

How to take Max value of alphanumeric field

Hi All,

I need to get max value of alphanumeric field, can any one help assist the same.

Please find attached screen shot.

Expression : MaxString({<ACTIVE_ACTION_Flag = {1}>}total [End ID])

Thanks

Santharubban KS

1 Solution

Accepted Solutions
sunny_talwar

May be this

Aggr(If(HISTORIZIED_Flag = 0,

If(SubField([End ID], '.', -1) = Max(TOTAL <[GPID Number]> SubField([End ID], '.', -1)), [End ID]),

If(PurgeChar(SubField([End ID], '_', -1), 'H') = Max(TOTAL <[GPID Number]> PurgeChar(SubField([End ID], '_', -1), 'H')), [End ID])), [GPID Number], [End ID])

View solution in original post

9 Replies
sunny_talwar

May be this

Aggr(If(SubField([End ID]), '.', -1) = Max(TOTAL <[GPID N...]> SubField([End ID]), '.', -1)), [End ID]), [GPID N...], [End ID])

Kushal_Chawda

if the number are always separable by dot them try like below

LOAD GPID,

        [Program ID],

        [End ID],

        subfield([End ID],'.',2) as Number

FROM QVD;

Now on front end, below expression should work

=max(total <GPID>Number)

santharubban
Creator III
Creator III
Author

Thanks Sunny.

for Active action i am good but for Historized actions i am not able to get . 

sunny_talwar

Not sure I understand?

santharubban
Creator III
Creator III
Author

Hi Sunny,

If you see my attachment, I have 2 different action one is Active and or this History action. For Active an I am getting right result but for History action i am not get correct answer as i marked in my attachment.

Exp:

Aggr(if(HISTORIZIED_Flag = 1 and SubField(SubField([End ID],'_',-1),'.',-1) = (Max(SubField(SubField([End ID],'_',-1),'.',-1))), [End ID] ), [GPID Number],[End ID])Max value.jpg

sunny_talwar

Can you post your application?

santharubban
Creator III
Creator III
Author

please find attached sample applications

sunny_talwar

May be this

Aggr(If(HISTORIZIED_Flag = 0,

If(SubField([End ID], '.', -1) = Max(TOTAL <[GPID Number]> SubField([End ID], '.', -1)), [End ID]),

If(PurgeChar(SubField([End ID], '_', -1), 'H') = Max(TOTAL <[GPID Number]> PurgeChar(SubField([End ID], '_', -1), 'H')), [End ID])), [GPID Number], [End ID])

santharubban
Creator III
Creator III
Author

Thanks Sunny I got it