As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
When user enters 11/30/06 the output should be like this AcctNo EntryDdate Market Value 1 11/30/06 -3500 2 11/30/06 1500 3 11/30/06 1000
Market value is calculated by subtracting the previous row market value for same AcctNo from the entrydate row market value(which is entered by the user) If no previous row is avialable before 11/30/06 it will display the same value as of 11/30/06 in output.
I remember you posted the same issue last month What was wrong with the answers you have got at that post
quote:
Posted July 11, 2007 03:42 PM i have a column called entry date which captures daily date details like account. i need to find the difference between todays date and yesterdays date amount details. final amount= amount with entry date of today - amount with entry date of yesterday
Hi Frank Solution that we got works fine only for 2 rows of data.Sinc ein my code i have sorted and selected by Highest 2 dates. If there are more than 2 rows then it will come different.So only side by side i am also trying out but also looking for some help. I am posting the code which we used last for our calculations
:::CODE::: SELECT ASSET_ID, FULL_MARKET_VALUE, ENTRY_DATE FROM MurexODS.ACCOUNTING_BALANCES ; -* -*STORING OUTPUT IN A TABLE TABLE FILE SQLOUT SUM FULL_MARKET_VALUE BY HIGHEST 2 ENTRY_DATE BY ASSET_ID ON TABLE HOLD AS HOLDNEW END -RUN -* -*STORING OUTPUT IN A NEW TABLE FOR COMPUTATION TABLE FILE HOLDNEW PRINT FULL_MARKET_VALUE COMPUTE CURR_MARKET_VALUE/D20.2 = IF ASSET_ID EQ LAST ASSET_ID THEN FULL_MARKET_VALUE - LAST FULL_MARKET_VALUE ELSE FULL_MARKET_VALUE; BY ASSET_ID BY ENTRY_DATE ON TABLE HOLD AS NEWFILENAME END -RUN -* -*STORING OUTPUT IN A NEW TABLE FOR RESTRICTION TABLE FILE NEWFILENAME PRINT CURR_MARKET_VALUE BY HIGHEST 1 ENTRY_DATE NOPRINT BY ASSET_ID ON TABLE HOLD AS NEWFILENAME1 END -RUN -*
We donot want highest 2 rows now. we just need to subtract the current row value from the previous row value depending upon the date being entered by the user.
But to come to the end result you have to make small stepps and this is one of them. You want to find the actual value and the previous value, so by running the program sorted on the highest two you get the highest and the previous record.
The next step is to calculate the difference of these two values.
If you want this done based on a day entered by the user you restrict the program with
WHERE ENTRY_DATE LE '&Entered_date';
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006