Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Distribution of values Behind code

Avatar

Community Advisor

Hi Everyone, 

Can someone please help me to understand from where I can find the code/logic behind "Distribution of values" option we have in query activity

 

kapilKochar_1-1615352775030.png

0 Replies

Avatar

Level 3

Hi Kapil,

This are usually all created using Input forms. You can find the code behind that in there. Go from Administration > Configuration > Input forms and search for Distribution of values form.

Thanks,

Avatar

Community Advisor
I checked that already but that form does not explain how grid is coming up on click of this button and how values are getting calculated

Avatar

Community Advisor

Hello @kapilKochar 

 

In the backend the query is using GroupBy in the queryDef.

 

You can achieve the same result by adding groupBy attribute in your queryDef code.

 

Here is the same code:

   select: {node:[
      {alias: '@expr', expr: field, groupBy: 'true', noSqlBind: 'true'},
      {alias: '@count', expr: 'COUNT()', label: 'Count'},
    ]},

Let me know if that helps.

 

Avatar

Community Advisor
Hi Manoj, Thanks for sharing this . I was more kind of interested to find out the view they using to display that grid inside form when we click distribution button. Do you know anything around that as well ? Thanks