Replace Crosstab query counts with "X"

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
I have a simple crosstab query that matches Training Classes with Job Titles.

All it does is list the job title as rows and Classes as column headers. Any matches currently return a 1 using a count on the class ID. This may seem trivial, but how can I replace the 1 with an "X"?

I tried using an expression expr1:Iif([CourseID]=1,"X","") but no luck.

Thanks,
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I don't do much with xtabs. My first thought is to create a second simple select query based on the original xtab query and include your iif... field substituting 1 for X there.

hth,

Rich
 
Upvote 0
I just tested revans' idea and it worked. I used this for my first query:
Code:
SELECT [01_Jobs].JobDescripton, [01_Classes].ClassName, [01_TrainingJobs].DateAttended
FROM (01_TrainingJobs INNER JOIN 01_Jobs ON [01_TrainingJobs].JobID = [01_Jobs].JobID) INNER JOIN 01_Classes ON [01_TrainingJobs].ClassID = [01_Classes].ClassID;

And then used this for my crosstab:
Code:
TRANSFORM Max(IIf(IsNull([DateAttended])," ","X")) AS DateAtt
SELECT qryForJobsTraining.JobDescripton, Max(qryForJobsTraining.DateAttended) AS [Total Of DateAttended]
FROM qryForJobsTraining
GROUP BY qryForJobsTraining.JobDescripton
PIVOT qryForJobsTraining.ClassName;

And it worked. I wish I had a way to upload a pic somewhere so I could show you but I don't currently have the ability to do so since I'm at work.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,258
Members
452,901
Latest member
LisaGo

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