﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Data Warehousing / Analysis Services  / Measure between dates / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 07:24:29 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Measure between dates</title><link>http://www.sqlservercentral.com/Forums/Topic1407691-17-1.aspx</link><description>If you want to use the Campaign as the filter element, then as I see it, you'd want to implement many-to-many.  The reason being, your campaign has two (2) dates, but based on what I've seen/heard, your joining (in the model) only on one (sounds like end date).Otherwise, the MDX would need to simply be filtered using the (assumed known) start and end dates for a given campaign - i.e. *you* need to know those dates and manually specify them.  This will obviously *not* work for a non tech end user situation.  Again, IMO, if you want it to work for end usrs, get a many to many relationship going (using a bridging table) between Campaign -&amp;gt; Bridge &amp;lt;- Date.A possible alternative to above, is to try to use the properties of the selected Campaign (eg have start and End date as attributes) and then striing them into the SELECT statement, sort of like "SELECT ........   FROM .....  WHERE[Date].[Date].' + CSTR(GetMePropertyromAttibutehere) + ':' + CStr(GetmeEndDatePropertyValuehere())  I haven't one this, but imagine it's possible.</description><pubDate>Thu, 17 Jan 2013 10:37:26 GMT</pubDate><dc:creator>stevefromOZ</dc:creator></item><item><title>RE: Measure between dates</title><link>http://www.sqlservercentral.com/Forums/Topic1407691-17-1.aspx</link><description>thank You Steve,But what would be the mdx query?I tried,SELECT NON EMPTY { [Measures].[Sales] } ON COLUMNS, NON EMPTY { ([Dim Employee].[Franchise Name].[Franchise Name].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( { [Campaign].[Campaign ID].&amp;[1] } ) ON COLUMNS FROM [Food Processing DWH]) WHERE ( [Campaign].[Campaign ID].&amp;[1] )But it is giving values at the enddate..i want the range of values between start and end date</description><pubDate>Thu, 17 Jan 2013 03:24:55 GMT</pubDate><dc:creator>aruna.sriram099</dc:creator></item><item><title>RE: Measure between dates</title><link>http://www.sqlservercentral.com/Forums/Topic1407691-17-1.aspx</link><description>Hmmm, extremely similar thread - si there a college problem we're all now trying to solve or folks are using multiple accounts maybe??  :hehe:Regardless, although on the other thread I had originally recommended adding the Campaign ID to the Fact, you can't do that *UNLESS* you can guarantee that there is (and will ever be) only 1 campaign running on any given date.  If you can guaranttee that, then sure, it can be part of the Fact.  If you can't, then you're going to want to look at Many to many.This thread also changes the problem/solution slightly (IMO) - to answer this specific question, you would likely just use straight MDX (ie use a specific report/query) where as on the other thread, one would use the cube design, though one could easily use MDX for that problem too.</description><pubDate>Wed, 16 Jan 2013 09:03:39 GMT</pubDate><dc:creator>stevefromOZ</dc:creator></item><item><title>RE: Measure between dates</title><link>http://www.sqlservercentral.com/Forums/Topic1407691-17-1.aspx</link><description>when i added the campaign key to the fact table i got the data between start and end date.But now i want the data between precampaigndate and start dateI tried this expression,({[Campaign].[PreCampaignDate]:[Campaign].[StartDate]},[Measures].[Sales])but it is giving null as result..</description><pubDate>Wed, 16 Jan 2013 02:33:59 GMT</pubDate><dc:creator>aruna.sriram099</dc:creator></item><item><title>RE: Measure between dates</title><link>http://www.sqlservercentral.com/Forums/Topic1407691-17-1.aspx</link><description>There is a very recent thread on this already[u]http://www.sqlservercentral.com/Forums/Topic1407198-17-1.aspx[/u]Mack</description><pubDate>Wed, 16 Jan 2013 02:32:51 GMT</pubDate><dc:creator>Mackers</dc:creator></item><item><title>RE: Measure between dates</title><link>http://www.sqlservercentral.com/Forums/Topic1407691-17-1.aspx</link><description>Not sure I get all that you are saying, as it seems simple enough just use "where Salesdate between campaignstartdate and Campaignenddate"Or am I missing something..</description><pubDate>Wed, 16 Jan 2013 02:28:43 GMT</pubDate><dc:creator>ShineBoy</dc:creator></item><item><title>Measure between dates</title><link>http://www.sqlservercentral.com/Forums/Topic1407691-17-1.aspx</link><description>I have a campaign dimension ( Its a marketing campaign for a product ) and i have to measure the sales that happened during the campaign , Each campaign will have a duration ( start date and end date ) For Example : a sample record in the campaign dimension looks like this CampaignKey : 1 CampaignName: XXXX Cam[aignStartDate :01-01-2012 CampaignEndDate :11-01-2012StartKey : 74561 ( refers to the primary key in time dimension ) EndKey :74667 ( refers to the primary key in time dimension ) i need to analyse the total sales that happened during a campaign , the cube should be able to get the sales figure that happened between the start date and the end date for the given campaign ( i also have a time key in the fact table ) To do this i have added campaign key to the fact table and got the result.But in my campaign table there are also columns precampaigndate and postcampaigndate which are campaigndate-duration and campaigndate+duration respectively.Now i want sales happend between precampaigndate to startdate and sales happend between postcampaigndate and enddate.Could someone please help me out how to do this??</description><pubDate>Wed, 16 Jan 2013 02:20:25 GMT</pubDate><dc:creator>aruna.sriram099</dc:creator></item></channel></rss>