Hi @nvpc,
There is no built-in function to transpose rows into columns dynamically. However, as long as you know the amount of columns that need to be added - we can add them manually. 😊 To keep the code short, I have created an example for the first 2 teachers.
ClearCollect(
colMergedClassGrades,
//Add columns to StudentClasses
AddColumns(
StudentClasses,
"Teacher - 1",
//Fetch the grade linked to the current ClassID & Teacher 1
LookUp(
TeachersGrades As Inner,
ClassID = Inner.ClassID && Inner.TeacherID = 1,
Inner.Grade
),
"Teacher - 2",
//Fetch the grade linked to the current ClassID & Teacher 2
LookUp(
TeachersGrades As Inner,
ClassID = Inner.ClassID && Inner.TeacherID = 2,
Inner.Grade
)
)
)
Using ClearCollect is not necessary, you can use the AddColumns code directly in the Items property of the gallery.
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!