{"id":9265,"date":"2016-08-30T10:45:18","date_gmt":"2016-08-30T10:45:18","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=9265"},"modified":"2016-08-30T10:45:18","modified_gmt":"2016-08-30T10:45:18","slug":"how-to-sort-array-in-ascending-and-descending-order","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/08\/30\/how-to-sort-array-in-ascending-and-descending-order\/","title":{"rendered":"How to Sort Array in Ascending and Descending Order"},"content":{"rendered":"<p><strong>Sorta<\/strong>-is used to sort arrays of single-dimensioned variables.<\/p>\n<p>Sorta, sorts the array in ascending order by default, to sort the array in descending we need to use Desc keyword.<\/p>\n<p>Syntax &#8211;<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2016\/08\/Ascending-and-Descending-Order.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-9266\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2016\/08\/Ascending-and-Descending-Order.jpg\" alt=\"Ascending and Descending Order\" width=\"506\" height=\"274\" \/><\/a><\/p>\n<p>Where,<\/p>\n<p>Sorta &#8211; Number Array List<\/p>\n<p>Number \u2013 number is length of an array or up to which number we want to sort<\/p>\n<p>Array List \u2013 list of array variable separated by comma<\/p>\n<p>&nbsp;<\/p>\n<p>In this example we are having two arrays, sorta command is sorting array NUMBER in ascending order and also STR array<\/p>\n<p>&nbsp;<\/p>\n<p>To sort these arrays according to STR array &#8211;<\/p>\n<p>Sorta 4 STR NUMBER or<\/p>\n<p>Sorta 4 STR<\/p>\n<p>&nbsp;<\/p>\n<p>To sort in descending order &#8211;<\/p>\n<p>Sorta 4 STR NUMBER\u00a0 Desc<\/p>\n<p class=\"Calibri\">Hope this helps.<\/p>\n<h5 style=\"text-align: center\"><span style=\"color: #098078\"><strong>About Us<\/strong><\/span><\/h5>\n<p style=\"text-align: justify\">Greytrix is one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product, system integrations, third party add-on development and implementation expertise.<\/p>\n<p style=\"text-align: justify\"><a href=\"http:\/\/www.greytrix.com\/\" target=\"_blank\">Greytrix<\/a>\u00a0have some unique solutions of\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\" target=\"_blank\">Sage X3\u2019s integration with Sage CRM<\/a>,\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\" target=\"_blank\">Salesforce.com<\/a>\u00a0and\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\" target=\"_blank\">Magento eCommerce<\/a>. It also offers best-in-class\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" target=\"_blank\">Sage X3 customization and development services<\/a>\u00a0to Sage business partners, end users, and Sage PSG worldwide.<\/p>\n<p style=\"text-align: justify\">For more information on Sage X3 Integration and Services, please contact us at\u00a0<a href=\"mailto:x3@greytrix.com\" target=\"_blank\">x3@greytrix.com<\/a>\u00a0.We will be glad to assist you.<\/p>\n<p><strong><em>Other Related Blogs:<\/em><\/strong><\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2014\/05\/25\/how-to-get-the-number-of-records-modified-by-update-command\/\">How to get the number of records modified by Update Command<\/a><\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2013\/12\/23\/list-the-files-from-the-directory\/\">List the files from the directory<\/a><\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2015\/09\/29\/how-to-overcome-the-table-full-error-in-sage-x3-while-importing-the-file\/\">How to overcome the \u2018table full\u2019 error in sage x3 while importing the file<\/a><\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2015\/04\/30\/how-to-link-and-order-by-with-different-tables-in-4gl\/\">How to link and order by with different tables in 4GL<\/a><\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2013\/01\/10\/error-while-importing-folder-in-sage-x3\/\">Error while importing folder in Sage X3<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sorta-is used to sort arrays of single-dimensioned variables. Sorta, sorts the array in ascending order by default, to sort the array in descending we need to use Desc keyword. Syntax &#8211; Where, Sorta &#8211; Number Array List Number \u2013 number is length of an array or up to which number we want to sort Array\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/08\/30\/how-to-sort-array-in-ascending-and-descending-order\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[924,1941,1942,1945,2126,2127],"class_list":["post-9265","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","tag-greytrix-blogs","tag-sage-x3-technical","tag-sage-x3-technical-assistance","tag-sage-x3-technical-blogs","tag-sort-array-in-ascending-and-descending-order","tag-sorta-tag"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/9265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=9265"}],"version-history":[{"count":0,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/9265\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=9265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=9265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=9265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}