on 07-11-2012 10:46 PM
i need to default a webi to display only, the current fiscal year period records.
in the universe (UNX) feeding the webi, the records are returned as follows, by order type, and fiscal year period, and amount
e.g.
ORDT1 2012006 100
ORDT2 2012006 150
ORDT1 2012007 110
ORDT2 2012007 160
ORDT1 2012008 120
ORDT2 2012008 170
as we are now in 2012007
i wish the webi, which is based over a universe, to only fetch the last two rows into the report.
this hopefully can be done when the report is scheduled, AND, when the next fiscal period comes up, i wish the webi only to display 2012008 and so on
so i am guessing, i need some kind of place to put some logic based around the day that the webi is run.
i do not want all the records returned to the webi, i am trying to filter them out, prior to hitting the webi, maybe in the query panel or universe ?
thanks in advanced
g
Hi Glen,
First off: if you're the author of the 'Caboodle' blogs: thank you for your effort!
To help you out, I've created a cube with 3 transactional records in it:
2222 2012006 100 BT
3333 2012007 110 BT
5555 2012008 120 BT
In response to your question: you could try the following:
1. Create a derived table in your DF, based on the 0FISCVARNT table.
a- Right click in your data foundation
b- Select 'Insert' > 'Derived Table'
Make sure you follow the syntax above and make sure you select 'Standard SQL-92'
This will create a derived table, with one record: the current fiscal year / period. I have chosen the 0FISCVARNT table for this, as it contains only a few records.
2. Join the new derived table to your fact table (in my case IB2AC003C)
a- Right click in your data foundation
b- Select 'Insert' > 'Join'
c- Select your fact table (ie the cube) and join 0FISCPER with CurFisPer as seen below
d- Detect cardinality and make sure that 'Outer join' is checked on the fact table side
3. Create (or refresh) your business layer
a- Make sure that the object [Derived Fisc Per\Cur Fis Per] is there
b- Publish your universe
4. Create a Webi on the new universe
a- Make sure to restrict [Fiscal Year / Period] on the [Cur Fis Per] object as seen below:
4. Results, voilà
Is this what you were looking for?
KR
Bart Santing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do this on the report
1. Create a variable
VAR1 = ToNUmber(Year(currentdate())+"00"+MonthNumberofYear(CurrentDate()))
what the above variable will do is it will get the value 2012007 or 2012008 depending on the month you are in.
2. Once you have the above create another variable
VAR2 = if(VAR1 = fiscal year period;1;0)
when you place this variable beside the fiscal year period column it will show 1 on the rows where you have 2012007 and 0 for other rows
3. Apply a report filter using var2 and set var2 =1 you will only see the rows where you have fiscal year period 2012007
Hope that helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In universe create a object which will give you the current fiscal period value. The below definition will work on oracle you need to modify it to fit other DB
Current Fiscal Month = TO_CHAR(sysdate(),'YYYY')||'0'||TO_CHAR(sysdate(),'MM')
so this will give you 2012007 once you have this object in your query apply a filter as below
Fiscal Year period = Current Fiscal Month and it will only return you the two rows and since the above definition will update automatically the month you run the report the next month you will get 2012008 and so on
Hope this is Helpful
hi tauseef, i am sorry, but you are going to have to spell this one out. i am not familiar with the IDT and UNX universes.
i have opened my UNX and where i can create objects in the Business Layer pane, if i create a filter there, i just dont know how to add your code, or even use it once added.
i do see the ability to set a filter on the data foundation of the universe, is that what you mean ?
please note, i am in information design tool of BI 4.0, not the older universe environments.
ta
g
if you are using IDT you will need to create the object in the Business Layer within the universe. The UNX file contains a connection, data foundation and business layer.
the above picture shows a Business Layer in the IDT. Right click on the Class yo want to add the new object in and select New -> Dimension
In the new window under SQL Definiton you will see area for SELECT clause paste the below definition over there
TO_CHAR(sysdate,'YYYY')||'0'||TO_CHAR(sysdate,'MM') and click ok your new object will be created. You can give a meaningful name to the object. Export or synchronize your project with the server to make this new object available to you.
Hope this is Helpful
It is ok if it gives you error because when you parse a object it looks for if it is associated with a table name in the definition the formula being used for the object we are not associating it with any table we are just using different oracle functions. You can save and export this object it will work ok on the report side
Please check below snap shots
Used the object in a sample query
Thanks,
Tauseef
Tauseef, I can see you're a skilled guy there - sorry for breaking in your thread.
Glen, are you using a JCO connection on BW and a Multisource-enabled Data Foundationon top? If so, Tauseef's PL/SQL code (which by the way is 100% correct) will not parse.
The Multisource-enabled universe restricts you to use only SQL-92 syntax (Standardized SQL) as opposed to native SQL- in this case: Oracle PL/SQL. The reason for enforcing SQL-92 is that you could potentially add another connection to the Multisource-enabled Data Foundation, say a MS SQL Server connection. SQL Server speaks T-SQL, which is slightly different from PL/SQL. They both should be able to understand SQL-92. Other databases (i.e. MaxDB) also speak SQL-92 as a second language.
Below an illustration of what I mean by 'different syntax':
PL/SQL SQL-92 T-SQL
to_char() toString() cast(... as char(..))
sysdate curDate() getdate()
|| concat(.., ..) +
I think this produces your error.
Can you try this create a filter in a universe with something like (Max (Fiscal Year) - 2) and drag this filter on the report.
also, in Webi you can create variable as per above logic and use that in the filter/condition as constant.
Regards,
Sujit Honrao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not sure, I got you, but if you do not want to create the filter on report level then you would have to create it at Universe level, however, even in that case, the filter will have to be dragged in the query panel while creating the report, It will work the same way even if you create the filter at the report level. Only difference n the filters will be...Universe filter is accessible to all and report is limited to this particular report.
Other option is to filter the data at the DB leve, but don't think its of any use here.
Regards,
Sujit Honrao
Yes, you can, however the above \\ "...(Max (Fiscal Year) - 2) "\\ is not the exact logic, you will have to figure out the correct one from the objects have, take the maximum year values to \\ to only fetch the last two rows into the report.\\
On second thought, if you want to display only last two values? did you try using Rank function to display top/bottom values?
Regards,
Sujit Honrao
Hi
What is the datasource you are using ? If u are using the BEx query as the datasource they u can write the customer exit.
Please let me know the datasource you are using..
Regards,
RaviChandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glen,
Create the query on the top of the multiprovider and then write the customer exit under cmod tcode and onthe top of that query create the universe and then create the webi on the top of that universe.
In the customer exit write the code to populate the current fiscal period data only.
I think this flow will display the output the correctly...
Regards,
RaviChandra
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.