Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I could not run the calculated field below, this is the logic but I am making a mistake somewhere.
=if(GetFieldSelections([Period])='Daily', sum({<DATE= {'$(vYesterday)'}>} IPCOUNT),
if(GetFieldSelections([Period]),'Weekly', sum({<DATE= {'$(vPreviousWeek)'}>}IPCOUNT)
if(GetFieldSelections([Period]),'Monthly',sum({<DATE= {'$(vPreviousMonth)'}>}IPCOUNT))))
This is the solution;
if(GetFieldSelections([Period]) ='Daily',
(sum({<Todayly= {'$(vYesterday)'}>} IPCOUNT1) + sum({<Todayly= {'$(vYesterday)'}>} IPCOUNT2) + sum({<Todayly= {'$(vYesterday)'}>} TotalCount)),
if(GetFieldSelections([Period])='Weekly',
(sum({<Todayly= {'$(vPreviousWeek)'}>} IPCOUNT1) + sum({<DATE= {'$(vPreviousWeek)'}>} IPCOUNT2) + sum({<Todayly= {'$(vPreviousWeek)'}>} TotalCount)),
if(GetFieldSelections([Period])='Monthly',
(sum({<Monthly= {'$(vAy)'}>} IPCOUNT1) + sum({<Monthly= {'$(vAy)'}>} IPCOUNT2) + sum({<Monthly= {'$(vAy)'}>} TotalCount))
)))
Hi, @Milaf
try correcting the syntax like this
if(GetFieldSelections([Period])='Daily',sum({<DATE= {'$(vYesterday)'}>} IPCOUNT),
if(GetFieldSelections([Period])='Weekly', sum({<DATE= {'$(vPreviousWeek)'}>}IPCOUNT),
if(GetFieldSelections([Period])='Monthly',sum({<DATE= {'$(vPreviousMonth)'}>}IPCOUNT))))
Thank you Matheus, I didn't notice the syntax there but I changed it when I saw it 🙂
Finally, I tried the one below, but the monthly one never works. I could not get the total of the previous month 😞
=if(GetFieldSelections([Period])='Daily',sum({<DATE= {'$(vYesterday)'}>} IPCOUNT),
if(GetFieldSelections([Period])='Weekly',sum({<DATE= {'$(vPreviousWeek)'}>} IPCOUNT),
if(GetFieldSelections([Period])='Monthly', sum({<MONTH= {'$(vMonthly)'}>} IPCOUNT)
)))
My Monlty variable is;
=Date(MONTH-31, 'DD.MM.YYYY')
I wrote above "sum({<MONTH= {'$(vMonthly)'}>} IPCOUNT) " works when I write 01.10.2023 instead of the variable in the formula. "sum({<MONTH= {'01.10.2023'}>} IPCOUNT) but it does not detect the variable value even though it is correct.
@Milaf
try this in your variable
vMonthly
$(=Date(MonthStart(AddMonths(today(1),-1)),'DD.MM.YYYY'))
@Milaf
Close the topic and mark the solution as accepted
Thanks!
This is the solution;
if(GetFieldSelections([Period]) ='Daily',
(sum({<Todayly= {'$(vYesterday)'}>} IPCOUNT1) + sum({<Todayly= {'$(vYesterday)'}>} IPCOUNT2) + sum({<Todayly= {'$(vYesterday)'}>} TotalCount)),
if(GetFieldSelections([Period])='Weekly',
(sum({<Todayly= {'$(vPreviousWeek)'}>} IPCOUNT1) + sum({<DATE= {'$(vPreviousWeek)'}>} IPCOUNT2) + sum({<Todayly= {'$(vPreviousWeek)'}>} TotalCount)),
if(GetFieldSelections([Period])='Monthly',
(sum({<Monthly= {'$(vAy)'}>} IPCOUNT1) + sum({<Monthly= {'$(vAy)'}>} IPCOUNT2) + sum({<Monthly= {'$(vAy)'}>} TotalCount))
)))