Min(date) since Max(date(
Answered
Hi,
I have two columns, Intake Date and Treatment Plan Start date. I want the report to display the first (min) Treatment Plan Start Date since the last (max( Intake Date
Hello Bell Frazier,
Thank you for reaching out to the Yellowfin Support Team.
While we are investigating this issue, could you please let us know the exact version and build of Yellowfin you are currently using so that we can replicate the same and get back to you with the findings.
Regards,
Yamini Naidu
Hello Bell Frazier,
Thank you for reaching out to the Yellowfin Support Team.
While we are investigating this issue, could you please let us know the exact version and build of Yellowfin you are currently using so that we can replicate the same and get back to you with the findings.
Regards,
Yamini Naidu
Are you going to tell me what that code should be?
Are you going to tell me what that code should be?
Hello Bell Frazier,
Sorry for the delayed response.
I've included a video that demonstrates how to create a report using calculated field with simple formula that could work for your scenario.
I believe this will be useful to you in some way.
Please go through the video and let me know if I'm not understanding something.
Regards,
Yamini Naidu
Hello Bell Frazier,
Sorry for the delayed response.
I've included a video that demonstrates how to create a report using calculated field with simple formula that could work for your scenario.
I believe this will be useful to you in some way.
Please go through the video and let me know if I'm not understanding something.
Regards,
Yamini Naidu
Let me try to explain a little better. I have a list of clients. Each clients has and intake date and some have multiple intake dates, if they they leave a come back. Each clients also has treatment plans, each with a start date. I would like to know the date of the first treatment plan since their last intake date. Basically, I need the statement to be:
Having (Min(treatmentplan_date)) >= (Max(intake_date))
But I cannot get this to work in Yellowfin
Let me try to explain a little better. I have a list of clients. Each clients has and intake date and some have multiple intake dates, if they they leave a come back. Each clients also has treatment plans, each with a start date. I would like to know the date of the first treatment plan since their last intake date. Basically, I need the statement to be:
Having (Min(treatmentplan_date)) >= (Max(intake_date))
But I cannot get this to work in Yellowfin
You may be able to do this in the view using a virtual table.
--vt_LastIntake_FirstTxPlanDate
SELECT client_id
, max(cv.rev_timein) last_intake
, firstPlan_Date = (
SELECT min(tx_start_date)
FROM Tx_Plans tp
WHERE tp.client_id = cv.client_id
AND tp.tx_start_date > max(cv.rev_timein)
GROUP BY tp.client_id
)
FROM clientvisit cv
WHERE cv.visittype_id = 100 /*visit type id for intake*/
GROUP BY cv.client_id
You may be able to do this in the view using a virtual table.
--vt_LastIntake_FirstTxPlanDate
SELECT client_id
, max(cv.rev_timein) last_intake
, firstPlan_Date = (
SELECT min(tx_start_date)
FROM Tx_Plans tp
WHERE tp.client_id = cv.client_id
AND tp.tx_start_date > max(cv.rev_timein)
GROUP BY tp.client_id
)
FROM clientvisit cv
WHERE cv.visittype_id = 100 /*visit type id for intake*/
GROUP BY cv.client_id
Thank you!
Thank you!
Hello Bell Frazier,
Hope you are doing well
You can try Jim Staple's suggestion and let us know if it works for you or not.
@Jim Staples, Thanks for responding to this.
Regards,
Yamini Naidu
Hello Bell Frazier,
Hope you are doing well
You can try Jim Staple's suggestion and let us know if it works for you or not.
@Jim Staples, Thanks for responding to this.
Regards,
Yamini Naidu
It worked! Just trying to figure out how to add the other columns as well. Thank you!
It worked! Just trying to figure out how to add the other columns as well. Thank you!
Hello Bell Frazier,
I'm glad to hear that.
If that clarified your concern, could we please close the ticket?
Let us know
Regards,
Yamini Naidu
Hello Bell Frazier,
I'm glad to hear that.
If that clarified your concern, could we please close the ticket?
Let us know
Regards,
Yamini Naidu
Yes. Thank you
Yes. Thank you
Hello Bell Frazier,
Thanks for the confirmation.
I'll go ahead and mark this ticket as answered.
Kind Regard
Yamini Naidu
Hello Bell Frazier,
Thanks for the confirmation.
I'll go ahead and mark this ticket as answered.
Kind Regard
Yamini Naidu
Replies have been locked on this page!