Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I cant seem to find the syntax error in the formula below but i would also like to add "If this is not populated I want the date to chose the current date".
how can I add this to the following syntax please.
So if the 'AsAtDate' is populated the date is taken from this but if left empty the data is taken from today.
SUM( {$<%Date<={AsAtDate}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions )
=SUM( {$<%Date ={'<=$(=if(len(AsAtDate)=0,Date(Today()),AsAtDate))'}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions )
Try this
SUM( {$<%Date<={ =Today() }, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions )
Regards
Anand
i would like to say "if there is no AsAtDate selected , then take today
The lazy way (outside set analysis) is:
if (getselectedcount(AsAtDate) =0,
SUM( {$<%Date<={=today()}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions ) ,
SUM( {$<%Date<={AsAtDate}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions )
)
You want to populate only Today date if you are not selecting anything??
Even before you think about adding the if statement, the current expression doesn't seem to look right. Is this working?
Sum({$<%Date<={AsAtDate}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions)
Are you not getting a error above??
=SUM( {$<%Date ={'<=$(=if(len(AsAtDate)=0,Date(Today()),AsAtDate))'}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions )
Would you not insert the default date today() value during the load of your data so you avoid the cost of handling this during the dashboards use?
or..
if (IsNull(AsAtDate),
SUM( {$<%Date<={=today()}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions ) ,
SUM( {$<%Date<={AsAtDate}, RecordType= {'WebTraffic'}, Area= {'SR'} >} Sessions )
)
congratulations Sunny