I am new to Appsheet and am having trouble working out how to do the following. I have tried to play around with expressions but am not getting very far. I have searched in the docs and also donโt really find anything that obviously addresses this. Maybe thereโs a tutorial ?
I have a simple app with based on 1 spreadsheet (of a list of mountains, which can be ticked off when climbed) with 1 deck view, 2 report views and the standard Forms for each. On potentially any / all of these I want to place some text at the top of the page saying, for example, โYou have climbed x% of the mountainsโ, where x is the % all rows where a column called Done = TRUE.
So I have 2 issues;
Any help much appreciated. Sorry if this is explained somewhere already.
Hi there,
Hereโs a quick app that has some of these examples in it, including:
Hope this helps!
For this, youโll probably want to use a column of type Show, which are described in here:
Show columns are positioned in a form like any other column. If itโs a normal (non-virtual) column, place it in your spreadsheet where you want it to occur in the formโprobably as the first column of the row. If you choose to use a virtual column, youโll need to use the more-advanced approach of using a slice to reorder the columns. Given that youโre new to AppSheet, I recommend using a column in your spreadsheet.
One of the configuration options for the Show column is Content, which allows you to enter an expression that will produce the text to be displayed. Youโll need to construct an expression that gives you what you want. It may look something like this:
CONCATENATE(
"You have climbed ",
ROUND(
(COUNT(FILTER("Mountains", [Done])) * 1.0)
/ (COUNT(FILTER("Mountains", TRUE)) * 1.0)
* 100.0
),
"% of the mountains"
)
FILTER("Mountains", [Done])
gets a list of all rows in the Mountain table where the Done column value is TRUE.
FILTER("Mountains", TRUE)
gets a list of all rows in the Mountains table.
(COUNT(FILTER(...)) * 1.0)
counts the number of rows given by FILTER(), producing an integer. Multiplying by 1.0 converts the integer to a real number.
(... / ... * 100.0)
computes the percentage as a real number.
ROUND(...)
rounds the percentage to the nearest integer.
CONCATENATE(...)
constructs the text of the message, including the computed percentage.
See also:
Show columns are da
Thanks steve - thats great and almost there. However My Text1 field as below still does not appear anywhere on any of my views and I canโt figure out whyโฆ
In UX >> Options, make sure Include Show columns in detail views is ON.
Thanks, that was off but is now on, but the Text column only appeared after I fiddled around with Column order or Header columns but itโs now as I wanted it.
Really appreciate this help to get up to speed. So if I may, a couple of other points โฆ
Nope.
Correct: there is no fine-grain layout control.
Nope, though a Show column can be virtual, so you could at least avoid the spreadsheet column.
Got it. Many thanks.
User | Count |
---|---|
18 | |
9 | |
8 | |
5 | |
5 |