title: yup: compare field itself with another field
body: <p>I had</p>
  
  <pre><code>StartIntensity: yup.number(),
  EndIntensity: yup
      .number()
      .when(
          "StartIntensity",
          (StartIntensity: number, schema: any) =&gt; {
              return !!StartIntensity
                  ? schema.moreThan(
                          StartIntensity,
                          "Max should be &gt; min"
                    )
                  : schema;
          }
      ),
  </code></pre>
  
  <p>but I need something like that</p>
  
  <pre><code>StartIntensity: yup.number(),
  EndIntensity: yup
      .number()
      .when(
          "StartIntensity, EndIntensity",
          (StartIntensity: number, EndIntensity: number, schema: any) =&gt; {
              return !!StartIntensity &amp;&amp; StartIntensity !== EndIntensity
                  ? schema.moreThan(
                          StartIntensity,
                          "Max should be &gt; min"
                    )
                  : schema;
          }
      ),
  </code></pre>
  
  <p>but code above doesn't work properly. Is there any possibility to make this work ot other ways to execute this validation?</p>