You can translate the question and the replies:

Functions on a URL

I have a baseview that works that I pass 4 parameters. The parameters and ULLAT, ULLNG, LRLAT, LRLNG. Together they specify a bounding box of latitude and longitude which the REST source uses in its query. I have another REST source that uses a latitude/longitude point and a radius. My goal is to compute a center point of the bounding box and compute the radius of the bounding box (I'll worry the about radius later). What I was trying to do was have a baseview that I passed ULLAT/ULLNG, LRLAT/LRLNG and compute the value on the baseview parameters. Is this a possible approach? If so, how do I tell VDP to use the functions? So, what I tried was the following on a rest endpoint for a baseview. It didn’t work because the VDP didn’t know to interpret the DIV and SUM as something it should do, instead of just passing it on the REST endpoint which didn’t like it.\{x:DIV(SUM(@ULLNG,@LRLNG),2.0),y:DIV(SUM(@ULLAT,@LRLAT),2.0),radius:1000,uom:”meters”\} What should I be doing? I will eventually union the working view with the one that needs the lat/lng and radius if that helps. Thank you,
31-10-2023 14:58:27 -0400

1 Answer

Hi, I understand that you are trying to use aggregate functions like SUM and DIV in the REST url of a view in Denodo Virtual DataPort and it is unsuccessful. If that is the case, I suggest you to create a derived view over the base view and provide the required operations within the derived view. Subsequently, you could publish the derived view as a REST web service. To create a derived view with view parameters, you could follow the below steps: * Open the Virtual DataPort Administration Tool and right click on the base view. * Then navigate to New > Selection > View parameters. * Mention the names of the parameters and choose the data type. * Then go to the Output tab > New field. * Give the suitable name for the output and use the expression with parameters. Example:Div(sum(var1,var2),2.0) and click OK. * Save the view, publish it as a REST web service and deploy it. * Use the below sample URL in the browser to access the newly created REST web service: <URL of the web service>?var1=<Value>&var2=<Value> Please replace the <URL of the web service> with the URL of the derived view and <Value> with the values of var1 and var2. Now you will be able to use the aggregate function for dynamic parameters accessed through REST web service. Hope this helps!
Denodo Team
01-11-2023 07:06:47 -0400
You must sign in to add an answer. If you do not have an account, you can register here