web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Want to create a report with multiple conditions and some aggregates using FetchXML in Visual Studio

(0) ShareShare
ReportReport
Posted on by

I have created a FetchXML Schema :

<?xml version="1.0" encoding="utf-8"?>
<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0" aggregate='true' >
<entity name="lead">
<!--<attribute name="modifiedon" alias='Modified_In_Current_Fiscal_Year' groupby='true' dategrouping='year' />-->
<attribute name="modifiedon" alias='Modified_On_Date' groupby='true' dategrouping='day' />
<attribute name="new_leadstage" alias='MQL_Leads' aggregate='count' />
<attribute name="new_leadstage" alias='SAL_Leads' aggregate='count' />
<attribute name="new_lgmeetingstatus" alias='LG_Meetings' aggregate='count' />
<filter type="and">
<filter type="or" >
<condition attribute="new_leadstage" operator="eq" value="100000002" />
<condition attribute="new_leadstage" operator="eq" value="100000004" />
<filter type="and">
<condition attribute="new_lgmeetingstatus" operator="eq" value="100000000" />
</filter>
</filter>
</filter>
<link-entity name="opportunity" from="originatingleadid" to="leadid" alias="Opportunities" link-type="outer">
<attribute name='actualvalue' alias='Revenue' aggregate='sum'/>
</link-entity>
</entity>
</fetch>

But, Not getting desired results :

FetchXML.PNG

I want this Result :

Daily Sales Report
Date 17th July 14th July 13th July 12th July 11th July 10th July 7th July 6th July 5th July 4th July 3rd July
Revenue $ $ $ $ $ $ $ $ $ $ $
July Revenue $ $ $ $ $ $ $ $ $ $ $
SAL # # # # # # # # # # #
MQL # # # # # # # # # # #


Please help me in this matter, if somebody has done a similar task like this.

Thanks in advance.

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans