Hola Equipo Appsheet
Estoy realizando una aplicaciรณn para una granja de gallinas ponedoras, debo ingresar los huevos recogidos cada dรญa, pero necesito sumar los huevos recogidos cada semana y ese dato agregarlo a otra tabla, como podrรญa hacer este calculo, Gracias
Hi @wijimenezz
Welcome to the community !
If this is about displaying aggregation, you may want to add a virtual column โWeekโ
with expression:
ISOWEEKNUM([yourDate])
Then, use a table view to display information with the Group_by option, pick โweekNumberโ, and calculation option : โSum :: Weekโ
For reference:
Here is an example of what it looks like:
with COUNT:
Thank You @Aurelien
The information is so helpfull,
I understand but what i want to do is create the accumulated of the eggs colected
Then
Day. Egss colected. Accumulated
Mon. 200. 200
Tus. 200. 400
Wed. 150. 550
Thu. 200. 750
Fri. 200. 950
Sat. 150. 1100
Sun. 200. 1300
So, when Day = Sunday , insert [Accumulated] in โanother tableโ
"
โAnother Tableโ
Week. Weekโs Egss. โฆ โฆ โฆOther information
Any Number. 1300
And when starts the Next week [Accumulated] should be begins with the number of [Eggs colected] from Monday
Example
Day. Eggs colected. Accumulated
Mon. 250. 250
Tus. 300. 550
โฆ
โฆ
Thanks for your Helpโฆ
OK.
Iโm not sure to understand properly: you donโt care about which week it is, just weekday ?
If so, you may want to create a table with just the weekday, and set a relation between that table and the one you have at the moment.
My suggestion:
table โEggCollectionโ (the one you have at the moment), with columns:
==> key: type Text, initial value expression UNIQUEID()
==> timeStamp: type DateTime, initial value expression NOW()
==> quantity: type Number
Slice โeggCollectionFromThisWeekโ, that will have the last weekโs rows only
==> source table EggCollection
==> row filter condition : [TimeStamp]>NOW()-7
Table โWeekโ, with columns:
==> keys: 1, 2 ,3, 4, 5 ,6, 7
==> Values: โsundayโ, โmondayโ, โtuesdayโ, etc
Back on table โEggCollectionโ, add a virtual column :
SUM([Related eggCollectionFromThisWeek][Quantity])
SUM(
SELECT(eggCollectionFromThisWeek[SumEggsCollected],
[WeekDay]<=[_THISROW].[WeekDay]
)
)
Please note:
WEEKDAY()
expression takes Sunday as day 1. You mway want to use SWITCH()
expression as an alternative in order to take monday as day 1.Note2:
Example for the alternative WEEKDAY() expression:
SWITCH(WEEKDAY([TimeStamp]),
1,7,
2,1,
3,2,
4,3
5,4
6,5,
6
)
For reference:
@Aurelien ok, thanks so much, I Will try Itโฆ I want to learn what you know, what do i need to study, where can i learn all of these expressions that You wrote hereโฆ
Regards from Colombia .
Thank You @Steve
User | Count |
---|---|
38 | |
35 | |
27 | |
23 | |
18 |