Dynamic Report Filters in Salesforce

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , with 12 Comments on Dynamic Report Filters in Salesforce

I have seen many customers in need to have Dynamic Filter. In Absence of Dynamic filter, many times we end up with creating multiple reports with same format and different condition.

Many time, we need something like get all cases related to Parent Account of Opportunity. We can simply create a report for Case and add Condition for Account Name. Using Some Custom Link, we can always Change Account Name and same report can be used many times.

While navigating to community i found very interesting and useful information regarding dynamic Filter in Reports.I thought that Dynamic Filters inside Salesforce is not possible but It is Possible.

Salesforce does not have any official documentation on this, but here how it works.

Lets have look in below image:

Dynamic Filter in Reporting
Dynamic Filter in Reporting

Above report have three Filters. First Filter will be considered as “pv0”, second filter will be considered as “pv1” and so on.

In URL, we can provide parameter for Pv0, Pv1 like in above image.

Now, we can create a formula field to create a dynamic link which will open report. Something like

https://ap1.salesforce.com/{!ReportId}?pv0={!MergeField0}&pv1={!MergeField1}

Related posts

12 thoughts on “Dynamic Report Filters in Salesforce”

  1. hi i want to get the operator value of pno from the user we can get that one in this dynamic report .i am creating the report where user can go to vf page he can enter the aCCOUNT NAME IT WILL take automatically and .incase user need some other logic like not equal to like that how we can do it

  2. Hi Jitendra,

    Thanks for this article. I have a situation where there are many BDMs for them creating the same reports but only changing the owner of the record. Eg. Open Opportunities report for many BDMs according to their opportunities. So I guess i can use dynamic filter for that. Once I create the link, how do I display that on a Dashboard so that whoever click the link will display their report on the dashboad.

    Any help is appriciated,
    Thanks.

  3. is it possible to allow user to select two different date field
    created date and lead qualified date , i want the user to select created date from — to —
    and lead qualified date from …. to ….
    user should select the date range

    I want to add the below logic
    (1 AND (2 OR 3) AND 4 AND 5)

    1. Five9 Log equals “True”

    2. Call Result contains “Lead” and created date from —- and to —-

    3. Lead Qualified equals and leaddate from —- and to —-

    4. External ID not equal to “”

    5. Territory Name equals “abc”

  4. Hi Jitendra

    I am working around a requirement, where the client wants three to four filters on a report. Say, Zone, Region, State, Product, From Date, To Date.

    So, if the user fills only Zone and hits the button to display the report, can my reports be this dynamic that it adds filter only specific to Zone. I see that in other case, it puts the other filters as blank and thus no data is displayed.

    Please help.

    Thanks.

  5. Hi Jitendra, can we achieve the same in Lightning? URL hacking is not possible in Lightning. I want to implement this in lightning as well.

  6. Hi Jitendra,
    I’m stuck in a similar scenario where in I want to add a filter in a Dashboard that would extract some detail of a parent record. Is it possible?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.