Have you ever used the If statement to convert the null into some special character mainly for Excel based reports? If then there is no need for it, you can easily achieve this via formatting
Let us first do this in a wrong way
In the below code I am checking for null values and if it is null then replace it with “–” . It works perfectly fine and it can be directly linked with excel reports and handed over to users
This has clearly produces the required result as shown below,
What is the best way then?
Though this is correct in terms of results there is a simpler way of doing this with format_String as shown below
So, Are we only talking about Aesthetic reasons here?
Actually no. Using the format option gives you lot of performance advantage in complex queries especially in Crosstab report.
E.g. Test the below query it takes around 30 seconds
Just change it with format option, it will get executed under 5 seconds and that should convince you.