Aggregation over empty foundset in NG Client

Forum to discuss the new web client version of Servoy.

Aggregation over empty foundset in NG Client

Postby dev-ws-011 » Tue Nov 17, 2020 9:23 am

Hi All,

Servoy aggregation on db table in NG Client, it is observed that aggregation over empty foundset gives NULL result rather than zero (Previously in Smart Client it gives zero result).

Any help will be highly appreciated to achieve zero result for aggregation over empty foundset in NG Client.

Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Aggregation over empty foundset in NG Client

Postby ROCLASI » Sun Nov 22, 2020 5:39 pm

Hi,

You can always use something like this:
Code: Select all
var myAggrValue = myAggrField || 0; // when null, undefined or even 0 failover to 0

It essentially works the same as COALESCE() is SQL.

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Aggregation over empty foundset in NG Client

Postby dev-ws-011 » Mon Nov 23, 2020 1:12 pm

Thanks Robert Ivens for the guidance.

I have tried this, but its not working because variable created is not connected with foundset. Hence, no correct value appears on UI.

Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Aggregation over empty foundset in NG Client

Postby ROCLASI » Mon Nov 23, 2020 3:01 pm

Can you show us your code? This will give more info on what you are trying to do.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Aggregation over empty foundset in NG Client

Postby dev-ws-011 » Wed Nov 25, 2020 12:54 pm

I am testing on a simple form. In body, grid is placed and in footer Count (aggregation of record count) is placed.

Using variable strategy will require a function call updating form variable to trigger whenever foundset change occur which is not required if we use aggregations.

Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Aggregation over empty foundset in NG Client

Postby dev-ws-011 » Wed Dec 02, 2020 2:42 pm

Any suggestion to achieve the results will be appreciated.

Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Aggregation over empty foundset in NG Client

Postby dev-ws-011 » Tue Dec 08, 2020 11:30 am

Case created.

Here is the URL:
https://support.servoy.com/browse/SVY-15682

Regards
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 5 guests