on 06-30-2014 9:45 PM
Hi, I have Account Effective Date dimension created and I have also Account Dimension created. Each account has multiple Account Effective Date but I need to get only recent effective date (one) for each account. In attached example I have account 1005 and the max date or recent date is 2010-07-01 and there are various accounts. How to get the max one? How can I achieve this in Information Design Tool? Thanks
Hi
Create derived table to give rank on different account eff date with respect to each account PS.
Using below sample code and get the rank.
SELECT Account PS Account Effective Date
RANK() OVER (PARTITION BY...)
From Source tables
Where specify any conditons
Account PS | Account eff date | Account eff date Rank | Amount | |
1005 | 2003-01-01 | 3 | 12121 |
|
1005 | 2010-07-01 | 1 | 2323 |
|
1005 | 2005-11-01 | 2 | 452435 |
|
2008 | 2014-07-02 | 1 | 454 |
|
2008 | 2014-06-20 | 2 | 676 |
|
2009 | 2014-01-01 | 1 | 454 |
|
And then create object : account eff date Rank in business layer and then filter account eff date Rank =1 in the query filters in webi report.
Then in the report able to see recent Account eff date (one) for each account PS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what I wrote to create a derived table. select @catalog('XXXXX')."SYSADM"."PS_LEDGER"."ACCOUNT", @catalog('XXXXX')."SYSADM"."PS_GL_ACCOUNT_TBL"."EFFDT", @catalog('XXXXX')."SYSADM"."PS_LEDGER"."POSTED_BASE_AMT", RANK () OVER (PARTITION BY @catalog('XXXXX')."SYSADM"."PS_LEDGER"."ACCOUNT" ORDER BY @catalog('XXXXX')."SYSADM"."PS_GL_ACCOUNT_TBL"."EFFDT" DESC) from @catalog('XXXXX')."SYSADM"."PS_LEDGER", @catalog('XXXXX')."SYSADM"."PS_GL_ACCOUNT_TBL" Where @catalog('XXXXX')."SYSADM"."PS_LEDGER"."ACCOUNT" = @catalog('XXXXX')."SYSADM"."PS_GL_ACCOUNT_TBL"."ACCOUNT"
Yes this is the correct answer and but the most recent one is not showing number 1. If we have three eff date it shows number 1 for oldest one and 3 for more recent one. In some cases we have two eff date for each account and in some cases 1 or three or more for each account. So if Number 1 shows the most recent one that is good. Any thought Thanks for your help. Bashir Awan
Hi,
I am using Information Design Tool 4.1. I am trying something similar however was thinking of using "max" function in business layer.
In Business Layer, the two folders I am trying to use the max function is Unit Name and Last Outage Start Date
I am trying to get max last outage start date for each unit name. I tried the function as below but do not know how to bring in the unit name.
max(@Select(SALES_FORECAST\Data part\Outage\Last Outage Start Date))
Your input will really help me.
Thank you.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.