# If-Then nested expression

**URL:** <https://pug.phocassoftware.com/t/if-then-nested-expression/2099>\
**Category:** Ask the Community\
**Tags:** erp\
**Created:** [January 25, 2022, 7:04pm UTC](https://pug.phocassoftware.com/t/if-then-nested-expression/2099 "2022-01-25T19:04:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lairdl](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@lairdl](https://pug.phocassoftware.com/u/lairdl)\
**Post date:** [January 25, 2022, 7:04pm UTC](https://pug.phocassoftware.com/t/if-then-nested-expression/2099/1 "2022-01-25T19:04:34Z")

</div>

I am looking to do a nested If-Then (new to coding, so I hope this is the corrrect term).  
case when X = Y then  
case when Z = A then B else C  
end  
else D end  
Will this work in Phocus?
