cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Joorge_c
Resolver I
Resolver I

My Sort function is taking the Number Value as Text and not as Values

Hi All,

My Sort function is taking the Value digits as text and sorting them as text and not as real Values.

 

Example

100

100000

222

333

 

and not as

100

222

333

100000

 

Any ideas on what I can try to fix this?

3 REPLIES 3
Drrickryp
Super User
Super User

Multiply it by*1

mahoneypat
Super User
Super User

You could use AddColumns to convert your text to numbers and sort by that.  In the example below, a table of numbers as text are converted to numbers with Value for sorting (confusing but the name of the column of the initial table is also called Value).

 

SortByColumns(AddColumns(["100", "1", "22", "33"], "numbers", Value(Value)), "numbers", Descending)

 

Regards,

Pat

Joorge_c
Resolver I
Resolver I

Thanks for the replies, I think I know what the issue is

 Im using a switch in the Sort which takes the UpdateContext of the Sort Icon OnChange of varSortG1 and denote the value, which then assign the sorting column. All sorting columns are Text, except for the 'Contract Amount' one with the issue. But if I swap the 'Contract Amount' at 1st, the sorting works on the Digits without issues.

 

Sort(
Filter(
CurrentR,
Entity_x0020_Adjust_x0020_for_x0020_S_x0020_Branches= Entity.Text
&& Agreement_x0020_Type = Dropdown_AgreementType_PSA.SelectedText.Value
),
Switch(varSortG1,"AName",Agreement_x0020_Name,"LOB",LOB,"ANumber",Agreement_x0020_Number,"Account",Bill_x0020_to_x0020_Account_x0020_Name,"CAmount",Contract_x0020_Amount),
Switch(varSortOrder1,true,SortOrder.Descending,false,SortOrder.Ascending)
)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,321)