Skip to Content
author's profile photo Former Member
Former Member

Can anyone solve this query requirement

Would like to know if anyone solved this situation in the query before. If yes, or If you have any ideas, could you please share it with me.

Below is the scenario.

Cube data: We have a number of 'FACILIIES'. 'Surveys' are conducted for each facility once in every six to 18 months. No fixed time intervals though. And surveys are numbered sequencially, always in the increasing order with respect to time. each survey has a 'survey date'. and a keyfigure 'Count'.

DATA IN THE CUBE AS OF 4/30/2005

FACILITY...SURVEYID...SURVEYDATE...COUNTKEYFIGURE

525... 121... 1/6/2004... 6

624... 132... 2/20/2004... 7

525... 138... 10/1/2004... 5

624... 140... 9/15/2004... 4

525... 157... 3/10/2005... 8

624... 245... 4/15/2005... 6

If the query is run for the above data, is shouls be displayed like this.

REPORT AS OF 04/30/2005

FACILITY...LATESTSURVEY...LATESTCOUNT...PREVIOUSSURVEY PRECOUNT

525... 157... 8... 138... 5

624... 245... 6... 140... 4

Once the data is updated further, this is the data in the Cube as of 10/30/2005

DATA IN THE CUBE AS OF 10/30/2005

FACILITY...SURVEYID...SURVEYDATE...COUNTKEYFIGURE

525... 121... 1/6/2004... 6

624... 132... 2/20/2004... 7

525... 138... 10/1/2004... 5

624... 140... 9/15/2004... 4

525... 157... 3/10/2005... 8

624... 245... 4/15/2005... 6

525... 290... 8/20/2005... 9

624... 312... 10/15/2005... 4

REPORT AS OF 04/30/2005

FACILITY LATESTSUREY LATESTCOUNT PREVIOUSSURVEY PRECOUNT

525... 290... 9... 157... 8

624... 312... 4... 245... 6

Dynamically, the latest survey and previous survey has to be determined. Any ideas on how to solve... We alrady thought of making changes to the Survey Master data. Any thing that can be done in the query itself?

thanks

Gova

(I could not improve the display format, so I used '...' to separate the fields. may be SDN should look into improving the display format)

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2005 at 03:39 PM

    Hi Gova..

    We too had a similar requirement..to get the previous records..

    We had to end up having to populate the Previous record in a seperate field on the same line..

    I think you are on the right path to modify the master data and have the previous survey and previous count populated on every line..

    Good Luck

    Ashish..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.