Can anyone help me with this? I have tried using PLUCK function nested in a SUM function but the result always returns a null 0 value even thought I know there is data there. I have changed the schema in the REST API data connector for the field in question to “number” but the sum functions still do not seem to recognize the field as a number for the purposes of using SUM functions.
This is very helpful Mari thank you. One follow up.
I am further trying to filter the lists to sum, by matching value from the list to a binded app variable called “wallet.address”
The collection has a “sellers” object with the following structure:
Using your instructions, I can sum the entire collection pulled from the API. I’m hoping to filter the collection before the SUM function so that I can summarize the total buying/selling activity of each user.
I am trying this: SUM_BY_KEY(SELECT((MAP(data.items, SET_KEY(item, “total_price”, NUMBER(item.total_price)))),“seller.address”==appVars.wallet_address),“total_price”) which returns a 0 value, even though the correct information in testing should be > 0 using known test data.
I think I’m doing something wrong with the select formula. Can you advise? I am an applied learning and your last post was immensely helpful in helping me understand how formulas and functions work.
I’ve also tried testing with a static string that matches the variable data to no success:
SUM_BY_KEY(MAP(SELECT(data.items, item.seller.address==“address_string”), SET_KEY(item, “total_price”, NUMBER(item.total_price))),“total_price”))
Hi, are you getting any errors in red in the formula or do you get a valid preview of what the result should be? Can you post a screenshot of what the formula looks like atm, and your app variable & data variable schemas?
The use case, I would like to filter the data collection by the item “seller.address” so that we are summing only items that match that criteria. The formula works great without the SELECT function, however as soon as I include it I get a none value, even thought I have 100% confirmed that there is data being returned in the data that matches the selection criteria.
I have then added that data as a data variable to the test page I created below.
In the attached sample response, there is 4 items within the asset_events object. 3 of those items match the SELECT formula as displayed here: SELECT(data.Opensea_events_stonercats1,item.seller.address==“0x72b62F6F66Fe33fA140F46678194c0CCa1e61cc4”).