0

I want to combine 1 and 2, but I don't know how.

I created a model like this. ①CalendarMaster【field→Index,Date,CalenderHoliday,CompanyHoliday】 ②AttendanceMaster【field→Index,EmployeeId,Date,GoingTime,LeavingTime】

I want to combine the date of the CalendarMaster and the date of the AttendanceMaster as a key.

I want to know the type of model and where to write the SQL query script. If you join the tables into one, I want to display [Date,CalenderHoliday,CompanyHoliday,GoingTime,LeavingTime] in one table.

I looked at various sites and tried relations, but it didn't work, so please help someone. I have been worried for another week. Waiting for advice.

Minami
  • 3
  • 1
  • Unless you do a lookup table similar to vlookup in Excel and as explained in the answer here https://stackoverflow.com/questions/58646976/in-app-maker-how-do-you-make-dynamic-table-cell-text/58660022#58660022, then you essentially need relations regardless. So what exactly have you tried with relations that didn’t work? – Markus Malessa Nov 28 '19 at 14:23
  • @Markus Malessa Thank you for quick reply.The model was created with Google Cloud SQL Table and related with AttendanceMaster (MANY) and CalendarMasterOneMany (ONE). I want to place a relational data source table on the page and display [Date, CalendarHoliday, CompanyHoliday, GoingTime, LeavingTime] as shown above. Even when the table is placed on the page, only the AttendanceMaster column is displayed. I researched on the net and tried prefetching, but after all I do not understand well. – Minami Nov 29 '19 at 02:39
  • Eventually, the client will filter the joined tables. I would like to know an effective method after taking this into consideration. – Minami Nov 29 '19 at 02:40
  • After introducing the prefetch you will also need to introduce additional fields in your table and then binding those fields to the relation like @datasource.item.YourRelationName.YourFieldName. – Markus Malessa Nov 29 '19 at 03:44
  • I tried binding after prefetching but it doesn't show up in the table....... – Minami Nov 29 '19 at 04:39
  • Which part doesn’t show up in the table? The related value or the option to bind the related field in the widget text binding? Do you already have data in both tables that you are expecting to be automatically related to each other when you set the table relation? If that is your expectation than unfortunately I have to tell you that is not how it works. You either need to use the built in import data with relations or you have to write a custom script to set the relation. – Markus Malessa Nov 29 '19 at 15:11
  • I noticed a mistake. You did not enter a value for FOREIGN KEY. The relationship was meaningless. How can I enter a value in a foreign key? – Minami Dec 04 '19 at 04:04

0 Answers0