Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to enter more than one IF statement into a calulated dimension within a chart straight table.
I have a field with lots of dates going back a number of years, and I want to place them into ranges (up to 1 Month old, 2 months old, 3 months old etc etc)
When I enter this it correctly finds the dates under 1 month.
IF(Due_Date>TODAY()-30, '1 Month')
However, when I enter another IF statement in the same expression like this, nothing is shown.
IF(Due_Date>TODAY()-30, '1 Month')
OR IF(Due_Date>TODAY()-60 AND Due_Date<TODAY()-31,'2 Months')
What am I doing wrong?
Hello Andrew,
I use to avoid that happening doing nested ifs, although performance may be severly affected. Something like (untested)
and so. Hope this helps.IF(Due_Date>TODAY()-30, '1 Month', IF(Due_Date>TODAY()-60 AND Due_Date<TODAY()-31,'2 Months'))
Hello Andrew,
I use to avoid that happening doing nested ifs, although performance may be severly affected. Something like (untested)
and so. Hope this helps.IF(Due_Date>TODAY()-30, '1 Month', IF(Due_Date>TODAY()-60 AND Due_Date<TODAY()-31,'2 Months'))
Andrew,
let me emphasize the importance of Miguel's comment.
IF statements, and especially nested IF statements, severely damage performance. Even if your application is very small, as a matter of learning and following best practices, move your IF question from the run-time back to the load time and create those additional buckets back in the script (typically it's done within the "Calendar" table, if you have one...)
cheers,
Thanks for your advice guys, I've used Miguel's suggestion, and used it in the load script instead.
It works well!