Access Report Using CrossTab Quary for people

CLCoop

Board Regular
Joined
May 30, 2018
Messages
56
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.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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"
 
Upvote 0
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..
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

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
Back
Top