Forum Discussion
Hariharan_R
Solution Sage
7 years agoFilter and Dynamic Result
Hi I have below tables and i need to get "Default/Bonus" (red colour columns) column on Trans table. Also mentioned the logic for the columns. We will be using RLS to filter the student....
Hariharan_R
Solution Sage
7 years agoIt is not giving the expected result.
Score table's year and Trans table's year should be considered and the value is based on the student logs in. if student B logsin then subject S2 only considered on the Trans table new columns.
Your script showing below result.
Ashish_Mathur
Super User
7 years agoHi,
Share data from both tables such that i can paste those in an Excel file. Also, show the exact result you are expecting.
- Hariharan_R7 years ago
Solution Sage
Hi
Table: Subject
Subject Student Subject A S1 B S2 C S1 Score StartDate EndDate Year Default Bonus Subject 3/1/2019 1:00 3/3/2019 4:00 2019 5 6 S1 2/1/2018 1:00 4/4/2018 4:00 2018 11 10 S1 4/1/2019 1:00 4/3/2019 4:00 2019 4 2 S2 2/1/2018 1:00 3/6/2018 4:00 2018 12 13 S2 ID CourseDateTime 1 3/1/2019 2:00 2 3/1/2019 3:00 1 3/3/2019 3:00 2 3/4/2019 3:00 3 3/4/2019 0:00 4 3/4/2018 0:00 5 1/1/2018 1:00
If Student A logs in the below result.
Expected result is as like below.ID CourseDateTime Default/Bonus CourseDateTime + (Default/Bonus) 1 3/1/2019 2:00 6 3/1/2019 8:00 2 3/1/2019 3:00 6 3/1/2019 9:00 1 3/3/2019 3:00 6 3/1/2019 9:00 2 3/4/2019 3:00 5 3/4/2019 9:00 3 3/4/2019 0:00 5 3/4/2019 5:00 4 3/4/2018 0:00 10 3/4/2018 10:00 5 1/1/2018 1:00 11 1/1/2018 0:00 If Student B logs in
ID CourseDateTime Default/Bonus CourseDateTime + (Default/Bonus) 1 3/1/2019 2:00 4 3/1/2019 6:00 2 3/1/2019 3:00 4 3/1/2019 7:00 1 3/3/2019 3:00 4 3/1/2019 7:00 2 3/4/2019 3:00 4 3/4/2019 7:00 3 3/4/2019 0:00 4 3/4/2019 4:00 4 3/4/2018 0:00 13 3/4/2018 13:00 5 1/1/2018 1:00 12 1/1/2018 13:00 The logic for the Default /Bonus column should be
if(CourseDateTime>Score.StartDate
&& CourseDateTime<Score.EndDate, Bonus, Default)- Ashish_Mathur7 years ago
Super User
Hi,
Are the dates in dd/mm/yyyy or mm/dd/yyyy format?
- Hariharan_R7 years ago
Solution Sage
Hi
dates are in mm/dd/yyyy format.
Thanks