Creating a pivot table

Hello
I have couple columns which I would like to make a summary table using EasyMorph. when I use pivot action, I dont get the format I want. does anyone know how to make pivot with the format below?

ID Region Task A
1111 North 11/1/2021
2222 South 12/1/2021
3333 East 10/1/2021
4444 West 11/1/2021
5555 North 10/1/2021
6666 South 12/1/2021
7777 East 9/1/2021
8888 West 9/1/2021
9999 North 9/1/2021
1222 South 11/1/2021
1333 East 11/1/2021
1444 West 10/1/2021
1555 North 9/1/2021
1666 South 11/1/2021
1777 East 12/1/2021
1888 West 9/1/2021
1999 North 12/1/2021
![image 247x433](upload://omWjpMzvu8VMZUXRP1L42p1zwLZ.png)

image

You can make a pivot table like in the project below.

pivot-dates.morph (4.8 KB)

However, if you need that pivot table in an Excel spreadsheet, the approach should be different:

  • Have a raw data sheet in the Excel spreadsheet.
  • Have another sheet with a pivot table that uses the raw sheet data as the source (make sure to tick “Refresh on open” in the pivot table properties).
  • Use the “Export to Excel” action in EasyMorph to replace the raw sheet data.
1 Like

Thank you so much. I actually figured it out , but your way is more complete. I also used year month as I needed it this way. So here is the follow up question. what if you want to group previous months or years, and just have the current month shown as independent?

Thanks

Not sure I understand. Can you provide an example?

In the above example I have each month showing separately in the pivot. I want to show previous months in one group (sum) separated from current month .
image

Re-label all months to “Previous Months” except December. You can use the “Modify column” action for that, or the “Rule” action.

1 Like

Thank you so much. is there any way that EM dynamically recognizes the current month and do that?

Yes, there is a number of date/time functions that you can use in EasyMorph: syntax:functions [EasyMorph Help]

You can use, for instance:

month(today())

If you’re not familiar with functions in EasyMorph, check out this tutorial article: Expressions | EasyMorph

1 Like

perfect. will check and let you know if any questions

quick question. How can we write if with two conditions in EM?( Ex. If year and month are not equal to current year and month , then put A else put B)

Did you read the tutorial article on expressions that I recommended? If not, please do.

I highly recommend going through the “Basics” and “Advanced” parts of the tutorial.

1 Like