When user says “last week”, filter using field [last_week] = 1
When user says “last 2 weeks”, “past two weeks”, “previous 2 weeks”, “the last two weeks”, filter using field [last_2_weeks] = 1
and for the caculation field, I added:
last_week:
ifelse(
addDateTime(-1,‘WK’,truncDate(‘WK’,now())) >= {Date Ending}
and
truncDate(‘WK’,now()) <= {Date Ending},
1,
0
)
when user say include “last week”, it shows me the right answer; but when they ask for last 2 weeks, it cannot answer the questions.
----------update--------
I find that it does not work when I say “active account in last 2 weeks”
but will work when I say " last 2weeks active account"
why this happen?
And once default date is configures and you should be able to ask prompts like
" show me active account in last 2 weeks " , " last 2 weeks active accounts" . And you can use custom instructions to provide further business process rules .
Did my suggestion help you in resolving your query? If yes, would request you to mark the post as “Solution”.
This will help the community to find guidance and answers to similar question. Thank you!
it still cannot work. I think that is because I have date_ending and time_grouping, where time_grouping is “weekly”,“daily”,“monthly”. so when I ask for last week, I should first filter the datending with timegroup is “weekly”