In this article you will learn about adding an aggregate function. The Adhoc feature of Helical Insight has a number of predefined aggregate functions like avg, count, max, min, distinct, sum, order by, group by, etc.
Now, based on your business requirement a new function can be added in the aggregate function list like median, mode etc.
In this case you have to manually add a new function in the list. For that, open the sqlQuery.properties file then add the new function in the list.
File Path : C:\Users\hi\hi-repository\System\Admin\sqlQuery.properties
sqlQuery.properties file details
Note: File path may vary based on the installation directory.
#The properties are used for the sql query functions mapping
db.generic.aggregate.avg=avg
db.generic.aggregate.count=count
db.generic.aggregate.distinct=distinct
db.generic.aggregate.max=max
db.generic.aggregate.min=min
db.generic.aggregate.sum=sum
db.generic.orderBy.order=order by
db.generic.groupBy.group=group by
db.generic.aggregate.mode=mode // Here we have added mode function
db.generic.aggregate.median=median // Here we have added median function
Note: The aggregate function which is to be added should be supported by database. If it is not supported by database then the function becomes inaccessible, even though it is defined in sqlQuery.properties file.
Now, you can use the new function present in aggregate function list in adhoc.
For more Info, contact us at demo@helicalinsight.com