Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
Hi dear,
I have written code like in the picture, I just want to print the max no without using max function.
Discussion posts and replies are publicly visible
Hi shukurs0001,
I want to understand your use case. Why do you want to do it without the max() function? Tho there are multiple ways of doing it, max() will be the most efficient way (as Chris also mentioned)
max() is fairly useless in, let's say, the case of having an array of CDT and wanting to find the element in the array with the max value on a particular element - in which case, the "todatasubset" sorting method listed above works pretty well overall.
Using max() with displayValue()?
I love displayValue().
a!localVariables( local!data: { 'type!{urn:com:gdit:types}COE_Sample_CDT'(step: 2, requestByName: "Mike"), 'type!{urn:com:gdit:types}COE_Sample_CDT'(step: 3, requestByName: "Harshit"), 'type!{urn:com:gdit:types}COE_Sample_CDT'(step: 1, requestByName: "Chris"), 'type!{urn:com:gdit:types}COE_Sample_CDT'(step: 4, requestByName: "Stefan") }, displayValue( max(local!data.step), local!data.step, local!data.requestByName, null ) )