Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Hope you could help me with the following:
var_max_date: =Max({1<Year={$(=Max({1}Year))},amount={">0"}>}date)
var_cur_week_start_date: =DATE(WeekStart(var_max_date), 'YYYY-MM-DD')
var_cur_week_end_date: =DATE(WeekEnd(var_max_date), 'YYYY-MM-DD')
I am calculating the amount for the current week:
in chart:
=sum({$<date={'>=$(var_cur_week_start_date)<=$(var_cur_week_end_date)'}>} amount)
It shows me the amount for the current week,but when I make selection in the date filter the amount for current selection is missing.
What can I do to preserve it?
Try this?
=sum({1<var_max_date ={">=$(var_cur_week_start_date)<=$(var_cur_week_end_date)"}>} amount)
Variables like this
LET var_max_date =Max({1<Year={$(=Max({1}Year))},amount={">0"}>}date);
LET var_cur_week_start_date =DATE(WeekStart(var_max_date), 'YYYY-MM-DD');
LET var_cur_week_end_date =DATE(WeekEnd(var_max_date), 'YYYY-MM-DD');
Expre:-
=sum({1<var_max_date ={'>=$(var_cur_week_start_date) <=$(var_cur_week_end_date)'}>} Val)
Sorry I don't understand why I should use var_max_date in the expression. var_cur_week_start_date that is calculated based on var_max_date.
sum({1<date ={">=$(var_cur_week_start_date)<=$(var_cur_week_end_date)"}>} installs_omn)
Also if I will use 1, other filters like region or product won't inluence on the resul, but they should. What can I do?
May be this?
sum({$<date ={"=Only({$<date = >} date) >= $(var_cur_week_start_date) and Only({$<date = >} date) <= $(var_cur_week_end_date)"}>} installs_omn)
It doesn't work, shows 0.
Sorry I don't understand why I should use var_max_date in the expression. var_cur_week_start_date that is calculated based on var_max_date.
sum({1<date ={">=$(var_cur_week_start_date)<=$(var_cur_week_end_date)"}>} installs_omn)
Also if I will use 1, other filters like region or product won't inluence on the resul, but they should. What can I do?
Could you solve your issue? I had the same problem and fixed it in the following way:.
When loading the information try having the numeric value of the Date in another field, for example:
DATE(dateField, 'YYYY-MM-DD') as date,
Num(dateField) as dateNum
And then use the numeric one in the set analysis:
=sum({$<dateNum={'>=$(var_cur_week_start_date)<=$(var_cur_week_end_date)'}>} amount)