Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for
Search instead for
Did you mean:
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
MVP

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

9 Replies
MVP

May be this

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

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)

Creator III
Author

Thanks Sunny.

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

MVP

Not sure I understand?

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

MVP

Can you post your application?

Creator III
Author

please find attached sample applications

MVP

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

Creator III
Author

Thanks Sunny I got it

Community Browser