Hi, I have two problems. I wanted to filter out items that are empty but after filtering it only shows me the first item in the list.
How can I multiply a number from a given list?
For example:
5 * 3
1 * 2
and
2 * 7
Hello @ @seba11 …Could something here help?
2 Likes
Change the List Lacing and you should get the remaining items.
There are a few things going on with your filtering.
- An empty or blank space is not the same as 0.
- ‘0’ is a string not a number.
-
x=='0'
is a condition. With no value assigned tox
, the value isnull
, making the conditionnull=='0'
. This of course returnsfalse
. - You’re now providing one
false
boolean as the mask to filter items, which is masking only the first item in your list. - You need to check each item against the condition and provide a list of booleans matching the list of filtered items.
What you have:
What you want:
From there you can multiply the filtered values by whatever you want.
2 Likes
As explained above, a blank or empty value is not the same as 0. You’ll get a null value when attempting any mathematical operation on it.
You would have to convert those empties to 0s first.
1 Like