cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Krishna_R
Responsive Resident
Responsive Resident

sort by columns

Hi All,

 

I'm having a text column called version, like 1.0,2.0,3.0....10.0,11.0,12.0

 

I'm trying to apply sort by columns on this version column as shown below:

 "Version",
        SortByColumns(
            vFilterSort,
            "Version",
            If(
                vSort.vDir = Descending,
                Ascending,
                Descending
            )
        )

 

when i tried to sort on text column it is giving like 1.0,10.0,11.0,2.0


I've tried something like this 

 "Version",
        SortByColumns(
            vFilterSort,
            Value("Version"),
            If(
                vSort.vDir = Descending,
                Ascending,
                Descending
            )
        )

 

but no luck. any help / suggestions here ?

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@Krishna_R 

 

The Sort function (rather than SortByColumns) would be another way to do this, which would avoid the need to call AddColumns:

Sort(
   vFilterSort,
   Value(Version),
   If(
      vSort.vDir = Descending,
      Ascending,
      Descending
   )
)

View solution in original post

2 REPLIES 2
Krishna_R
Responsive Resident
Responsive Resident

I've founded workaround like this

"Version",
        SortByColumns(
            AddColumns(vFilterSort,"VerNum",Value(Version)),
            "VerNum",
            If(
                vSort.vDir = Descending,
                Ascending,
                Descending
            )
        )

hope there might be some better way as well

timl
Super User
Super User

@Krishna_R 

 

The Sort function (rather than SortByColumns) would be another way to do this, which would avoid the need to call AddColumns:

Sort(
   vFilterSort,
   Value(Version),
   If(
      vSort.vDir = Descending,
      Ascending,
      Descending
   )
)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,973)