How to get the last value from the Information register?

Common questions about 1C:Query language, Query builder tool and Data composition schema

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 18, 2012
Company:

Hi!

I have created the CurrencyRates periodic information register, with Currency dimension and Rate resource. Now I need to get the last record for the specific currency. How can I do this?

 
#2
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

Hi, Lies Susann!

You need to use a query like following:

Code
SELECT
   CurrencyRatesSliceLast.Rate
FROM
   InformationRegister.CurrencyRates.SliceLast(&Period, ) AS CurrencyRatesSliceLast
WHERE
   CurrencyRatesSliceLast.Currency = &Currency

 
#3
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Nov 2, 2011
Company:

Hi Susann. I want to add important remark to Xin Wang answer: use filter by dimension like parameter for SliceLast virtual table.
It is very important for query performance.

Code
SELECT Rates.Rate
FROM InformationRegister.CurrencyRates.SliceLast ( &Period, Currency = &Currency ) as Rates

 
#4
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 18, 2012
Company:

Thank you, Xin Wang and Dmitry Reshitko!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.