• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Multiple charts from one query

Guest
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

I have a database containing demographic information for visitors to various sites. I would like to create a separate chart for each site summarizing its demographics. My SQL statement looks something like this:

SELECT SITE, RACE, LANGUAGE, GENDER FROM VISITS GROUP BY SITE

Can this be used to generate a series of charts, one for each site? About the only thing I have come up with is a loop using cfoutput's group option and cfchartdata to get individual data points and I don't think even that would work since I'm not sure how I can construct a loop to accomplish this. Thought I'd see if there was an alternative that I overlooked before I threw myself into it..
TOPICS
Advanced techniques

Views

230

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

How about Query of Queries...

-- Get Main Query: queryMain


-- Prepare first Chart for Site A: querySiteA
SELECT from queryMain where Site = ''siteA'

-- Show Chart with: querySiteA

-- Prepare first Chart for Site B: querySiteB
SELECT from queryMain where Site = ''siteB'

-- Show Chart with: querySiteB



Query of Queries is great for this kind of thing, no need to go back to the DB, you have the data, now just further filter it for your needs...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

LATEST
Exactly what I wanted. Many thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation