Access Report Using CrossTab Quary for people

CLCoop

Board Regular
Joined
May 30, 2018
Messages
54
Tyring to build a report that shows Organization and position that people are in.

For example:
There is a table that shows all employees (admin) and them in the respective positions
Sort ORderOrgBig BossManagerWorker
1South Groupme
1South Groupvacant
2North GroupTom
2North GroupSara


Using a query I've done a Totals (group) but cant seem to get following output.
1South GroupYouVacant
2North OfficeTomSara

Can't seem to get a query to do a group on office then put all the name in one row... I've tried using Group by on Organization Description and Sort then Boss, Manger, Worker set at last, first and group...
I get something like this.. UGH please help
1The OfficeVacant
2North OfficeNorth Worker

I've tried then building a report that would all so do this to no avail.
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,069
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
If the following is an acceptable format then use the Mcode shown below from Power Query

Book1
ABCDE
1Sort ORderOrgManagerWorkerBig Boss
21South Groupmevacant
32North GroupSaraTom
Sheet2


VBA Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Sort ORder", Int64.Type}, {"Org", type text}, {"Big Boss", type text}, {"Manager", type text}, {"Worker", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Sort ORder", "Org"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Attribute]), "Attribute", "Value")
in
    #"Pivoted Column"
 

CLCoop

Board Regular
Joined
May 30, 2018
Messages
54
quick question
Excel.CurrentWorkbook... this is a table within Access so should I put source = Table.tablename() and should this VBA code best go behind button to execute or on loading a form? thinking push a button have this code run then open a form with the data...

Thank you for your help..
 

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,069
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
No. Actually, you manually import table into Power Query. Click on the link in my signature to learn more about Power Query. In the PQ menu on the Data Tab, you will import Databases and select Access and then the particular table/query.

This is not VBA. This is Mcode which is the language for Power Query.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,358
Messages
5,601,149
Members
414,431
Latest member
JustmemyselfandI

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top