Sorting One of Column from Pivot Table

Hallo everyone

I just started to learn RPA, i already create system for save attachment excel from outlook, then i create the pivot table. But Now, i confused because i have to sort one of the columns.

Did you have any idea of next step i have to do after create the pivot table to sort one of the colum? Am i have to copy the pivot table as data table in new sheet? or i just have to use invoke code after create the pivot ?
Thankyou

Hey @aranadya

Welcome to @UiPath_Community
I would suggest while you are creating the pivot table and giving the input source, just sort the source range/table before creating the pivot table, using the Sort Range Activity.

Screenshot for your reference:

If this helps you, then mark this post as a Solution!

Best regards,
Ajay Mishra

@aranadya

welcome to the community

you can use sort range

cheers

Thankyou Mr.Ajay, but actually the target column that i need to sort is column in formatted previous day, which means it will update everyday. like in this attachment
WhatsApp Image 2024-09-03 at 01.03.56

Thankyou Mr.Anil, i also try this, but always fail

@aranadya then use Now.AddDays(-1).ToString("M/d/yyyy") in column name field.

Regards,
Ajay Mishra

@aranadya

Can you show what you tried and what what error are you getting

Cheers

Thank you Mr.Ajay

Actually i have to create pivot from excel, then i have to shorted the value in column day-1
image

I also already try to sorting di value column, but the result is warning log “column doesn’t exist”

@aranadya Is it possible to share a screenshot or a file of input and expected output, it’ll help me to suggest you correct solution…!

Regards,
Ajay Mishra

Sure, Mr.Ajay

this is the process i need
first, i have to create privot table. Then after that (Shown in pict1), the table value is unsorted. I want to Sort column Day-1/previous day/in cell contain number “24” using Descending method.


actually i still have another expectation step to capture just Top 10 value
from Day-1 and Day-2. But for now, i am focusing on sorting that column.

That’s all Mr. Ajay

in the pivot table created


a column titled “Row Labels”

That’s all Mr.Anil

Hi @aranadya

If possible can you share that excel file, no problem if it’s dummy data.

Regards,

@aranadya

In that if you see you mentioned only sheet you need to mention the pivottable as well using the name…please verify the screenshot provided by me

If you specify sheetname only then it would consider first row of excel as header and not the header row

Cheers


i try to put .PivotTable(“abc”
because i also named my pivot “abc”
the error messages
“Sort Range: The range abc does not exist.”

Thank You Sir