Hi all,
I have got this requirement where 'Week' number is used as multi select check box prompt. Requirement is to fetch 2 weeks of data for any selection.
Example :
Prompt Display value
Week 1 & Week 2
Week 2 & Week 3
Week 3 & Week 4
If option 1 and 2 are selected I would like to get the data for Week 1,2, 3. similarly if option 1 and 3 are selected I would like to get data for 1,2,3,4. Any suggestions in this regard is appreciated !
do you already have an approach in mind? or you need us to give you information how to solve this?
also, if first option was selected, does it mean you need two weeks data starting from today?
are those all the prompt? you only need 4 weeks of data?
do you have a week column in your date dimension? or you plan to calculate weeks from a date column?
are you using dimensional or relational source?
do you already have an approach in mind? or you need us to give you information how to solve this? : I have tried out an approach which is working only if the prompt is changed to single select. So any suggestion I will try out.
[Week] in (?ParamWeek? , ?ParamWeek?+1)
also, if first option was selected, does it mean you need two weeks data starting from today? I have a week column in the date dimension. So filtering is required based on the week column.
are those all the prompt? you only need 4 weeks of data? I have put sample data out there. Prompt would have all the values till 53 weeks
do you have a week column in your date dimension? or you plan to calculate weeks from a date column? We have a week column in date dimension
are you using dimensional or relational source? : Relational
Assuming that the prompt use value is the first week of the two weeks displayed, you could add a data item to your query: c_PrevWeek: [Week] - 1
Then the detail filter would be: [Week] in ?p_Week? or [c_PrevWeek] in ?p_Week?
Quote[Week] in (?ParamWeek? , ?ParamWeek?+1)
As seb24c suggested
Assuming:
Prompt Display | Prompt Value |
Week 1 & Week 2 | 1 |
Week 2 & Week 3 | 2 |
Week 3 & Week 4 | 3 |
Try this:
[Week] in ?ParamWeek? OR [Week]-1 in ?ParamWeek?
Awesome ! Thanks seb24c and Andrei I. It works like a charm.
good that its working.
just curious you did say that your prompt is multi select check box prompt right?
how about if you selected more than one value? does it still work right?
or did you changed your prompt to single select?