Select to view content in your preferred language

Dynamic Content - adding sums

2361
5
05-16-2022 06:55 AM
TimBarlow
New Contributor

I'm using Dynamic Content - Expression to summate two fields with distances in metres and convert to km and display the distances in Text widgets:

Text 1:      SUM({Dist1})/1000

Text 2:      SUM({Dist2})/1000

These two work OK.

I then try to add the two together:

Text 3:      SUM({Dist1})/1000+SUM({Dist2}]/1000

This won't work - I just get the name I gave the expression, both on the build view and when I run it. I don't get the "invalid expression" message in the expression builder or any other errors. How can I add together the two summations?

5 Replies
KevinMWright13
Regular Contributor

Hi Tim,

No solution here, just a show of support.  I have experienced this issue as well and would be interested in any work arounds or updates.  The expression tools are currently a bit limited so I look forward to the Experience Builder  team digging into this and expending its use.  They've created a really great toolkit that has an immense amount of potential as it develops.

Thanks,

Kevin Wright
Data Visualization Enthusiast
ShengdiZhang
Esri Regular Contributor

Hi @TimBarlow 

I tried a similar expression and it worked.

Can you check if you are using the default view in the expression, since the selected feature view is used by default.

ShengdiZhang_1-1652775988555.png

Regards,

Shengdi

 

0 Kudos
TimBarlow
New Contributor

Hi Shengdi

Yes, I'm using the default view for this.

I also have another problem now - the ones that worked e.g.

Text 1:      SUM({Dist1})/1000

This works with the default view. However if I create a new view to filter the data before summation (inc_file is y) then it no longer works. There is data after filtering, which I can see in the table when I create the view.

Regards

Tim

 

 

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi, I cannot reproduce this issue either, can you share a sample app with me? My username is she10946.

0 Kudos
JK_GIS_HELP
Emerging Contributor

Big shot in the dark here @TimBarlow - but did you ever figure out the issue causing this quirk? I'm experiencing the same exact thing in my expressions which are confirmed to be Double, Numeric, with no Nulls. The individual expressions calculate correctly but when I try to get a percentage via "/" it returns only the expression name.

0 Kudos