How can change all numbers of a column a percentage?

how can change all numbers of a column a percentage, in this example of the tableview column's "HHGanadas"

the tableview is work with mysql query

Give us an example of a number you want to change to a percentage.
Then show us the result you want after the change.

I don't know if it's possible but I want to split the 'jobs' column with the 'HHGanada' column, how can I do it from AppInventor? and then that result goes as a percentage to HHGanada

Show us an example with real numbers?

236149 divides 2024.3000000000002 and in theory it should give 0.74%

format as decimal((2024.3000000000002/23614)*100 for 2 places) text JOIN with '%'

Do you need blocks for that formula?

yes, although I also need some way to take the entire "HHGanada" and 'Trabajo' column and convert it, but I don't know if to do a query or how

You can select both columns by name in SQL, and get them in a table, right?

Then you need to create a new empty table and add a new column with the results from the division, multiplication by 100, and formatting, row by row and cell by cell. That's a for each row in table loop.

I don't think SQL is smart enough to do this for you, so you have to code it.

1 Like

and how? ._., i try but i can't D:

First get all the data from PHP(finally you have created table view successfully,Glad to see) and then instead of sending all the data to table try to create the table by row by row using clock or index method. There by you can convert required cells and put it into table view

Another method. Get all data put every column into separate list.during the process convert the required column into percentage. Then by using length of the list create table view (this will take some time I hope)

1 Like

You have some examples to learn how to do all that, and thanks <3

Something like this:

image

Note: the data in the second column of the tableview are now strings, not numbers, so to work on them as numbers, either use the orginal data, or remove the %

4 Likes


i can't work with mysql query D:, how skip words?

The operation yail-divide cannot accept the arguments: , ["HHGanadas"], ["trabajo"]

Looks like you have a list of lists of lists.

You will need a second select list item: list/index=1

Also you cannot use a mathematical operation on a string of letters


like this?, any way show " The operation select list item cannot accept the arguments: , ["HHGanadas"], [1]
Note: You will not see another error reported for 5 seconds."

Proyecto_N2 (2).aia (132,7 KB)
i attach my .aia

This should work:

You needed to replace the 5th item of the item (entire row) not the entire LIST. I excluded the header row.

You have an error in your data at index 110, you have letters (dsc) in the cell, instead of a number. This breaks the calculation. Also if you have a 0 at index 7 this will also break the calculation.

I haven't changed it, but did you mean to divide index 7 by index 5 ?

You do not do anything with the resultant local LIST. Should this be displayed in the TableView ? If so, you need to reorganise your blocks.

Note: you have 25 yellow errors, and 1 red error on your screen2 blocks.

1 Like

And how can I make it skip the data with value 0?, so that it does not break the calculation

please give a sample data, and what you exactly want to achieve.

What have you tried? Have you used and if condition to test for 0 ?