on 06-29-2015 5:50 AM
Hi Experts,
We had a requirement of creating a chart which should show current week + previous 3 weeks of data with an input control of Week number that is if we enter week 19 in the selection field in input box we can fetch 19,18 ,17 ,16 data . We have now acheived it
Please refer the screenshot of the report which we have created .
However now the requirement changed . Client wanted us to use the week number at query level with the same functionality .
Like -if we put week number filter in the query level and when the user selects the week number while refreshing the report then it should fetch current + previous 4 weeks . Please help me as how to create the same functionality in query filter . It is very urgent.
Looking for your reply
TX,
DP
try below solution:
create two objects on universe
Star_Week =if [week]-4 <= 0 then (52-(4-[week])) else [week]-4
end_week = [week]
Query1:
On this query provide prompt for user on [week] object & in select choose start_week & end_week objects
Query2:
On this query apply where condition on week object like
[week] >= end_Week and [week]<= start_week
where end_week would be result from another query & same for start_week.
So by using this logic you can achieve your output.
Thanks,
swapnil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is your data source? Bex, Oracle, SQL Server, etc?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, my Teradata isn't great but the basic idea is to build a predefined condition in your universe.
As long as you can work out the current week ending date then you can build the condition. Pseudo code will be something like:
table.transaction_date between current_week_ending_date - 27 and current_week_ending_date
I *think* it would be something like:
table.transaction_date between ((DATE-DAYOFWEEK(DATE))-20) and ((DATE-DAYOFWEEK(DATE))+7)
Regards,
Mark
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.