locked
Creating a chart that displays a count of 'no' answers RRS feed

  • Question

  • New to CRM.  I have a field that contains 'yes' and 'no' responses.  I'm looking to create a chart that shows the number of 'no' responses.  It appears that my only options are count:All and count:Non-empty.  Is there a workaround to achieve what I'm looking for?

    Wednesday, March 12, 2014 3:49 PM

Answers

  • Hi,

    You can create a system view(Customizations--> Select Entity--> Views--> New) on that entity and add a filter condition(Response as No in your case) to get the records based on your requirement and use it while creating the chart.

    You can select the view while creating a chart in CRM. So that it will display as per your requirement.

    --

    Gopinath

    http://mscrmtechie.blogspot.in/

    • Edited by Gopinath Reddy Wednesday, March 12, 2014 4:34 PM
    • Proposed as answer by Gopinath Reddy Wednesday, March 12, 2014 5:27 PM
    • Marked as answer by crm_user114 Wednesday, March 12, 2014 9:00 PM
    Wednesday, March 12, 2014 4:34 PM

All replies

  • Hi,

    You can create a system view(Customizations--> Select Entity--> Views--> New) on that entity and add a filter condition(Response as No in your case) to get the records based on your requirement and use it while creating the chart.

    You can select the view while creating a chart in CRM. So that it will display as per your requirement.

    --

    Gopinath

    http://mscrmtechie.blogspot.in/

    • Edited by Gopinath Reddy Wednesday, March 12, 2014 4:34 PM
    • Proposed as answer by Gopinath Reddy Wednesday, March 12, 2014 5:27 PM
    • Marked as answer by crm_user114 Wednesday, March 12, 2014 9:00 PM
    Wednesday, March 12, 2014 4:34 PM
  • Thank you Gopinath! 
    • Proposed as answer by Gopinath Reddy Wednesday, March 12, 2014 5:28 PM
    • Unproposed as answer by Gopinath Reddy Wednesday, March 12, 2014 5:28 PM
    Wednesday, March 12, 2014 5:20 PM
  • If your requirement is satisfied, please mark the thread as Answered as it will be helpfull for others...

    --

    Gopinath

    http://mscrmtechie.blogspot.in/

    Wednesday, March 12, 2014 5:30 PM
  • You can select the view used for preview of the chart, but this is not stored against the chart in any way. A user can use the chart against a view that contains yes or no answers and they will see the count of whatever records they are viewing. So this does not meet your requirements, I am afraid.

    You can achieve what you want by exporting the chart and editing the XML. In there you can add a filter that links the entity to itself, and filters for only records where response="no". You can also make it more obvious what the chart is doing by just counting the primary key (GUID) field - this has the same name as the entity, by default. Eg if you are counting Cases, count the Case field, not your bit field, and just Count:All, not "Contains data"

    So, in the chart xml, inside the <fetchcollection> section, inside the <entity> tags, add something like this (I'm assuming your new_responsefield has a value of 0 corresponding to "no"):

    ...
        <filter type="and">
          <condition attribute="new_responsefield" operator="eq" value="0" />
        </filter>

    </entity>
    ...

    Reimport your chart as a new one (or overwrite the existing one). Wherever it is used now, it will display only the count of records with a response of "No" - if you use the chart against a view filtered for records with a response of "yes", this will display an error that there are no records to display in the chart, otherwise "yes" records will just be ignored.

    Make sure your chart has a very clear and obvious name so that users understand why the total number of records in the chart might not match the total number displayed in the view.


    Hope this helps.
    Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011
    UK CRM Guru Blog

    • Proposed as answer by Adam Vero Thursday, March 13, 2014 7:29 AM
    Wednesday, March 12, 2014 7:09 PM