# Discussions

Â View Only

## Formula two fields two comparisons

• #### 1.  Formula two fields two comparisons

Posted 07-19-2022 12:57
Edited by Alexander Kouzmine 07-19-2022 14:11
Hello All,

I've managed to get to this point

Case(true,
ToDays(Today()-[Class Start Date])<35, "In Training",
ToDays(Today()-[Class Start Date])>=35 and ToDays(Today()-[Class Start Date])<77, "Supervised",
ToDays(Today()-[Class Start Date])>=77, "Production",
"Hasn't Started")

The complete logic that I need is

If [Program Assignment] = "Brokerage" then
Case(true,
ToDays(Today()-[Class Start Date])<35, "In Training",
ToDays(Today()-[Class Start Date])>=35 and ToDays(Today()-[Class Start Date])<77, "Supervised",
ToDays(Today()-[Class Start Date])>=77, "Production",
"Hasn't Started")

If[Program Assignment] = "Acquisition" then
Case(true,
ToDays(Today()-[Class Start Date])<35, "In Training",
ToDays(Today()-[Class Start Date])>=35, "Production",
"Hasn't Started")

Is it something possible to achieve?
Thank You

------------------------------
Alexander Kouzmine
------------------------------

• #### 2.  RE: Formula two fields two comparisons

Posted 07-20-2022 15:24
try this
var text BrokerageResult =
If [Program Assignment] = "Brokerage" then
Case(true,
ToDays(Today()-[Class Start Date])<35, "In Training",
ToDays(Today()-[Class Start Date])>=35 and ToDays(Today()-[Class Start Date])<77, "Supervised",
ToDays(Today()-[Class Start Date])>=77, "Production",
"Hasn't Started");

var text AquisitionResult =

If[Program Assignment] = "Acquisition" then
Case(true,
ToDays(Today()-[Class Start Date])<35, "In Training",
ToDays(Today()-[Class Start Date])>=35, "Production",
"Hasn't Started");

IF
[Program Assignment]="Brokerage", \$BrokerageResult,
[Program Assignment]="Acquisition", \$AcquisitionResult)

------------------------------