1

I have a simple app that takes attendance for a list of students. There are two datasources, a students table with first name, last name, id, and site, and an attendance table with first name, last name, date and present.

I want to be able to log attendance by getting a list of the students, entering a date, and check a box if they're in attendance or not (boolean column).

What I would like to do is pivot the attendance date for a new view so that instead of having a column with distinct dates, I'll have a columns for each date showing the value of the checkbox.

Ex:

Attendance 1:
First      Last      Date   Present
Bob        Smith     10/1   0
Bob        Smith     10/2   1
Bob        Smith     10/3   1
Kevin      Brown     10/1   1
Kevin      Brown     10/2   1
Kevin      Brown     10/3   1

New Pivoted View:
First      Last      10/1   10/2   10/3
Bob        Smith     0      1      1
Kevin      Brown     1      1      1

Is there a simple way to get this result in App Maker?

EDIT: For clarification. The primary purpose of the app is to capture attendance data in a classroom setting. So there is a flow where a teacher pre-populates a list of students and then checks the boxes down the line to log where a student was present/absent.

What I would like to be able to do is provide a page that presents the attendance data in a wide format so teachers can also look across the columns to see who was there on a given day.

Sledge
  • 1,245
  • 1
  • 23
  • 47
  • 1
    You can probably get something similar accomplished by using a calculated SQL model, but you would need to introduce 31 columns to account for the possible 31 days within a given month, also it appears that the version of MySQL that App Maker uses does not support the pivot command directly, so you would need to do a bunch of if statements in the query on top of that. Probably would be time consuming to write it up. If you can describe what you need this for we might be able to present an alternative. – Markus Malessa Nov 08 '19 at 22:16
  • Yep, that's a good callout. I added some clarification in an edit. – Sledge Nov 11 '19 at 22:16

0 Answers0