Select to view content in your preferred language

Data expression Date

429
1
07-06-2023 12:11 PM
Kristofer
Regular Contributor

Hi All,

I wanted to use below given data expression

Data Expression:-

var portal = Portal('https://www.arcgis.com/');
var fs = FeatureSetByPortalItem(
portal,
'b2c50a7730a74f8d808262ce0c37ac79',
0,
[
'date',
'location',
'total_vaccinations',
'people_vaccinated',
'people_vaccinated_per_hundred',
'people_fully_vaccinated',
'people_fully_vaccinated_per_hun',
],
false
);

// Find the most recent date from the date field to filter the FeatureSet for the latest record
var maxDate = Text(Date(Max(fs,'date')),'YYYY-MM-DD');
return Filter(fs, 'date = @maxDate');

 

But Instead of Max date function I want to return today records only.

 

Regards,

Sunita

 

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

You can use the Today function.

var todayDate = Text(Today(),'YYYY-MM-DD');
return Filter(fs, 'date = @todayDate');
0 Kudos