Hello everyone,
Basically, when I delete an alphanumeric value from a ListView, it's deleted via its index. What if there's a number inside the value, which I want to subtract from a label?
Regards
Nicola
Er, get the index of the list item and select the value, use this in your calculation ?
Use for each number from/to block, to find your item, in case of duplicate values in your list
Basically, in this photo, the ListView value is composed of "€10 followed by today's date," which corresponds to a cash inflow. Now, if I delete this value, I'd like the "Total Income" to go from 40 to 30.
- Get the selected item while you want to delete it. (10€ Sab, date)
- Split the selected item at €. ([10],[€ Sab, date])
- Then subtract the first item of this splitted value from the total income (40-10=30)
Got it?
In picture your list item is clear but in query you haved quoted like this "€10 followed by today's date".
Which one is correct?
So we can suggest you better
Don't go looking in a ListView for your data.
Look in the data base, spreadsheet, or table where it lives.
ListViews are like restaurant window sushi, for show, and not fit to eat.
Also, keeping sums is a recipe for errors.
Calculate your sums from the data where it lives, as you need it, by looping over the data.
Would it be possible to perhaps include a spreadsheet inside the app and work from that?
For an offline solution you might be interested in the local sqlite darabase
You can access it with an extension, for example App Inventor Extensions: SQlite | Pura Vida Apps
And use the powerful sql language to query your database to filter, sort, aggregate, and join data.
There are also other sqlite extensions around...
Taifun