Forum Discussion
monojchakrab
Resolver III
3 years agosum only numeric strings in a list containing both numeric and text strings
I am working with a list as follows : {"x", "100","200") And I want to sum only the 100 and 200, skipping the text string [the text string is not at a fixed loaction in all the lists, so list.skip ...
- 3 years ago
See here
List.Sum(List.Transform({"x", "100","200", "x300", 500}, (x)=> if Value.FromText(x) is number then Value.FromText(x) else 0 ))
Vijay_A_Verma
Most Valuable Professional
3 years agoSee here
List.Sum(List.Transform({"x", "100","200", "x300", 500}, (x)=> if Value.FromText(x) is number then Value.FromText(x) else 0 ))monojchakrab
Resolver III
3 years agoThanks Vijay_A_Verma - that worked like a charm. I was missing using the function, which simplifies the code.