Skip to main content
Solved

Generic Inquiry HAVING SQL Clause

  • Dec 11, 2020 1:21 AM UTC
  • 7 replies
  • 906 views
  • Translate All

rodman
Freshman I

Does anyone have a clever way to use a Parameter in a Generic Inquiry to generate a HAVING clause in SQL right after the GROUP BY clause? It generates a WHERE clause which doesn't allow me to work with the aggregation results.

I can do an on-the-fly filter, but I was hoping to use a Parameter.

Best answer by TimRodman

Thanks for following up on this @mrysev and @vkumar.

I was able to come up with a pretty cool workaround with help from @wyattERP:

https://www.augforums.com/forums/acumatica-generic-inquiries/using-parameters-to-filter-aggregate-results

View original

7 replies

Forum|alt.badge.img+6
  • Captain II
  • Dec 11, 2020 2:53 AM UTC

@timrodman  Tim, it looks like we are seeking for same kind of function.
I don’t know how to achieve this directly in GI. However, I’ve thought out a workaround that might get the “Having” filter out results.
You can take a look at below:
 

 

I also would like to know if you have better thoughts.

Translate

TimRodman
Pro III
Forum|alt.badge.img+1
  • Pro III
  • Dec 11, 2020 5:15 PM UTC

You can do it when using an on-the-fly filter by clicking on a column heading and applying a filter. But it doesn’t look like it works with a Parameter.

Translate

Forum|alt.badge.img
  • Acumatica Support Team
  • Dec 23, 2020 4:27 AM UTC

Hi Tim,

 

I’m not sure regarding your particular case, but you can consider 2 possible workarounds:

  1. Use Pivot Tables. 
  2. Create custom DAC + SQL view with aggregation and base your GI on it. In this case you will work with parameter in WHERE clause.
Translate

Forum|alt.badge.img+12
  • Acumatica Support Team
  • Dec 23, 2020 4:31 AM UTC

Hi @TimRodman 

Can you attach your GI XML and point to the column and the way you want to see the filtering to work? We will explore further for a solution.

Regards,

Translate

TimRodman
Pro III
Forum|alt.badge.img+1
  • Pro III
  • Answer
  • Dec 23, 2020 5:06 AM UTC

Thanks for following up on this @mrysev and @vkumar.

I was able to come up with a pretty cool workaround with help from @wyattERP:

https://www.augforums.com/forums/acumatica-generic-inquiries/using-parameters-to-filter-aggregate-results

Translate

Irina
Community Manager
Forum|alt.badge.img+8
  • Acumatica Platform Analyst
  • Feb 2, 2021 9:20 PM UTC

Hello @TimRodman,

Can I create a KB article out of your brilliant solution?

Translate

TimRodman
Pro III
Forum|alt.badge.img+1
  • Pro III
  • Feb 2, 2021 11:37 PM UTC

Sure thing @Irina 

Translate