Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How do i do this if statement as a flag perhaps.
Data
ID,Student,Teacher,Class,Position
1,John,James,Art,student
2,James,Paul,Art,Teacher
3,Sue,James,Art,student
4,Mark,Paul,Maths,student
The if statment
If student and teacher have the same class, so John and Sue have Art with James, so the count in the flag will be 3.
Thanks
hi,
no need for an if statement there are two ways
first, make a key field like below
Student&'-'&Teacher as Student_Teacher_Key;
If you want to do it in the Backend script:
data1:
//step 1
load ID,Student,Teacher,Class,Position,
Student&'-'&Teacher as Student_Teacher_Key;
load * Inline [
ID,Student,Teacher,Class,Position
1,John,James,Art,student
2,James,Paul,Art,Teacher
3,Sue,James,Art,student
4,Mark,Paul,Maths,student
];
data2:
load Class,Count(Student_Teacher_Key) as cuontOfStudent_Teacher_Key
Resident data1
Group by Class;
exit Script;
Just do
sum(cuontOfStudent_Teacher_Key)
in frontend
If you want to do it in the Front end script:
data1:
//step 1
load ID,Student,Teacher,Class,Position,
Student&'-'&Teacher as Student_Teacher_Key;
load * Inline [
ID,Student,Teacher,Class,Position
1,John,James,Art,student
2,James,Paul,Art,Teacher
3,Sue,James,Art,student
4,Mark,Paul,Maths,student
];
exit Script;
Just do
count(Student_Teacher_Key)
in frontend