Hi Jakaria,
Yes you write it in macro.
can you brief about what exactly you want to implement because it depends on the transformation type. For most of them (like Text/XML) you can simply use this one
{%
if (...) {
...
}
else {
...
}
OR
you can use ternary operator like below.
{%(a=="value1")? "some test 1": a=="value2"? "some test 2": "some test 3"|(identity)GlobalAdministrator%}
Thanks
Happy to help