This topic is locked

Adding filter items to Charts

4/18/2012 10:03:42 AM
PHPRunner General questions
A
ant author

Can someone please assist me how to add multiple items in charts.

Table for leaddocs

SELECT

ID,

LeadID,

Type,

Date,

reference,

Document

FROM leaddocs

I am using a stacked graph item to capture the number of documents processed on a daily basis and then want to add stacked items within the chart to show the type of document captured based on a filter variable depending on the "type" of document captured which is a lookup field . I am able to created 2 seperate graphs;

  1. Total documents captured
  2. Total Invoices captured
    I would like to show both with the same graph but not sure how to add a filer item in the querry and at the same time show the total documents captured.
    Not sure if this makes sence. The Invoice is captured by the type field in leaddocs

    Query for "Processed Invoices"

    SELECT

    Date AS Process Date,

    COUNT(Type) AS COUNT(Type)

    FROM leaddocs

    WHERE (Type = 'Timeout Invoice')

    GROUP BY Date

    ORDER BY Date DESC

C
cgphp 4/18/2012
SELECT

Type,

COUNT(*) as count_type,

Date,

reference,

Document

FROM leaddocs

GROUP BY Type

ORDER BY Date DESC
A
ant author 4/20/2012


SELECT

Type,

COUNT(*) as count_type,

Date,

reference,

Document

FROM leaddocs

GROUP BY Type

ORDER BY Date DESC




Hi Cristian
I tried the above Query for documents but it still gives me the same result. It shows all documents processed, I want to show all documents and stack those documents that are Invoices filter(Type = 'Timeout Invoice') on the same graph.

C
cgphp 4/20/2012

Could you make an example with an image?

A
ant author 4/20/2012

The initial Query;

SELECT

Date AS Process Date,

COUNT(ID) AS No Docs

FROM leaddocs

GROUP BY Date

ORDER BY Date DESC


Invoice Query

SELECT

Date AS Process Date,

COUNT(Type) AS COUNT(Type)

FROM leaddocs

WHERE (Type = 'Timeout Invoice')

GROUP BY Date

ORDER BY Date DESC


Your new query

SELECT

Type,

COUNT(
) as count_type,

Date,

reference,

Document

FROM leaddocs

GROUP BY Type

ORDER BY Date DESC*