Compare measures by dynamic Date filter.

Hello,
I have Date dimension with Hierarchy Year.Quarter.Month and Measure.Amount.
I would like to know if it is possible to compare measures on selected Date dimension level comparing 1 year before.
For example there are values
Month Amount
2012-01 10
2012-02 20
2012-03 30
2013-01 40
2013-02 50
2013-03 60
When I browse cube I need to create Calculated member (Amount_last_period) like the following:
Month Amount
Amount_last_period
2012-01 10
2012-02 20
2012-03 30
2013-01 40
10
2013-02 50
20
2013-03 60
30
I need to do it dynamically. If I choose to output quarters' amount it is need to compare quarter's data.
Any help or thoughts would be helpful.

Hi VB,
You can use ParallelPeriod in combination with Currentmember.
An example from the AW cube:
WITH
MEMBER [Measures].[Prior year Reseller Sales Amount] AS
ParallelPeriod(
[Date].[Calendar].[Calendar Year],
1,
[Date].[Calendar].CurrentMember
[Measures].[Reseller Sales Amount]
,FORMAT="Currency"
SELECT
([Measures].[Reseller Sales Amount]),
([Measures].[Prior year Reseller Sales Amount])
} ON COLUMNS,
{[Date].[Calendar].[Calendar Quarter]
} ON ROWS
FROM [Adventure Works]
Philip,

Similar Messages

  • Best Practise comparing measure with historic data?

    Hello everyone,
    we are currently trying to compare a measure for a certain week with the same measure of the weeks before. To make a condition such as: "If number of alerts in the 3 previous weeks > 100 then 1 else 0 [for this specific week]".
    However we are struggling because it seems that Measures and Dimensions are strictly separated from each other. "number of alerts" would be a measure, "week" would be a dimension. When creating a measure only other measures are available in the formula creator, when creating a dimension only other dimensions are available. In our understanding we would have a formula with both measures and dimensions in it.
    Any suggestions?
    Thanks in advance!
    Marvin

    thank you for your fast reply. That's a good thought, however I currently don't see a possibility for aggregations in the formula of a dimension. Hence the logic "if number of alerts in the previous 3 weeks  > 100 then 1 else 0" still struggles me.
    The values in my table are on the alert-level but for my measure I have to aggregate them at the level of the object, where the alert occurred (a dimension).

  • Compare daqmx event with dynamic data

    Good evening everyone!
    Our project is now facing a problem with LabView.
    For our project, we need to use daq to acquire current for our SOC. We want to use virtual channel so people can choose channels from the front panel directly. But when use DAQmx Virtual Channel, the task out is daqmx event which can be used for further calculation like multiple times to get our SOC, also can not compare with a constant.
    Could anybody help me  with this question? How can I extract the value inside the task out for DAQmx or convert daqmx event to dynamic data directly  ??

    So you changed your DAQ Assistant to attempt to use the DAQmx API.  Normally, I would say "Good for you".  But if the code was working, why change it?
    Mimic what I did with the Analog Output.  See how I configured before the loop, wrote inside the loop, and closed after the loop?  You should do the same thing with the Analog Input, except you do a DAQmx Read instead of a write.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Filter for two dynamic dates

    Hi all,
    I wanted to create a report such that i can see only last 20days of data. Basically i wanted to use a date filter, what is the exact syntax for the filter?
    The data in the table is in DD-MON-YYYY format.
    I am trying with the following query
    to_date(day_name,'DD-MON-YYYY') > trunc(current_date)-15 and to_date(day_name,'DD-MON-YYYY') <= trunc(current_date).
    Is this syntax correct?
    Thanks in advance.

    TIMESTAMPDIFF(SQL_TSI_DAY, Date.Date, CURRENT_DATE) will calculate the number of days between the Date column and the current date.
    Replace Date.Date with the Analytics column reference of your choice.
    You can also replace CURRENT_DATE with another date expression to calculate the difference between tow date columns.
    SQL_TSI_DAY defines the unit of measure (days)... other options are
    SQL_TSI_WEEK
    SQL_TSI_MONTH
    SQL_TSI_YEAR
    SQL_TSI_HOUR
    SQL_TSI_MINUTE
    SQL_TSI_SECOND
    Mike L

  • Tabular: fast patterns for dynamic banding of measures by 'effective date'?

    I've implemented
    http://www.powerpivotpro.com/2012/04/aged-debtorsdynamic-banding-in-dax/ but it's very slow - 5min+ to render a simple excel pivot table that's filtered to 2 invoices from a model that's ~130meg and has around 500k invoice payment
    schedule rows in the largest fact table. Cube deployed to server as opposed to power pivot/excel. I changed some of the logic to get rid of the 'as at' dynamic filtering in the linked blog and use a timeline instead to select all the dates from
    the beginning of time to my effective date, but it's still 30sec+ refreshes.. Just wondering if there's better patterns out there that use v2 dax and are faster. My transposing might've also introduced some inefficient logic because I don't have a central
    'transactional' table to work from.
    My model looks like - [table](relevant columns,...)
    [invoice](invoice date) 1:m [payment schedule](due date, amount due) 1:m [Payment] (payment amt, payment date)
    in words: an invoice is raised. An invoice can be made up of part payments that are due at different times, a payment can be for part or all of a payment schedule.
    The model works for 'as at now' reporting, but I'd like to implement a banded aged debtor report as at a specific date in a way that is usable.
    My current implementation doesn't include all the features and it's already pushing a minute of excel processing for a very filtered subset of data. Don't want to imagine how long it'd take for the full set.
    some data
    -- invoices
    SELECT *
    FROM (Values
    (1,'1 jan 2015'),
    (2,'15 jan 2015'),
    (3,'20 jan 2015'),
    (4,'21 jan 2015')
    ) as t(InvoiceID,InvoiceDate)
    --payment schedule
    SELECT *
    FROM (Values
    (1,1,'1 feb 2015',$100),
    (2,2,'15 feb 2015',$50),
    (3,2,'15 mar 2015',$50),
    (4,3,'20 feb 2015',$50),
    (5,3,'20 mar 2015',$50),
    (6,4,'21 feb 2015',$25),
    (7,4,'21 mar 2015',$25),
    (8,4,'21 apr 2015',$25),
    (9,4,'21 may 2015',$25)
    ) as t(PaymentScheduleID,InvoiceID,DateDue,AmountDue)
    -- payments
    SELECT *
    FROM (Values
    (1,1,'10 Jan 2015',$50),
    (2,1,'11 Jan 2015',$50),
    (3,2,'10 feb 2015',$50),
    (4,4,'25 feb 2015',$50)
    ) as t(PaymentID,PaymentScheduleID,DatePaid,AmountPaid)
    The bands I have are
    BandID Band Label BandStart BandEnd
    1 Future -999999999 -31
    2 Current -30 0
    3 1-30 days 1 30
    4 31-60 days 31 60
    5 61-90 days 61 90
    6 91-120 days 91 120
    7 120+ days 121 999999999
    anything due more than 30 days into the future is 'future', anything due in the next 30 days is current, anything that's due in the past is overdue.
    The 'effective date' filter should exclude any invoices that were raised in after the effective date and exclude any payments made after the effective date.
    expected output:
    Thanks
    Jakub @ Adelaide, Australia Blog

    See if the blog below helps:
    https://cwebbi.wordpress.com/category/dax

  • Compare scalar value to dynamic data

    I am trying to compare a scalar number input in the front panel to a dynamic data set(from DAQ) and return a boolean true if the condition is met. How can I compare one value to each data point in the acquisition data set?

    You can use the Convert From Dynamic Data and convert to a 1D array. The comparsion functions work with an array as one input and a scalar as another. The output is a Boolean array - the results of each element in the array to the scalar. I think you can also use the Comparison Express VI but I have seldom used any of the Express functions so I'm not sure about that.

  • Creation of Dynamic Date Variables to be used in WebI reports

    What we are trying to achieve is to create 4 optional filters (Current Day, Current Week, Last Week, Last Month) on 4 different dates which will allow the users to use them in WebI reports.
    When using an optional SAP Customer Exit variable in BEx and creating a Universe on top, the filter becomes mandatory (i.e. the whole Universe is filtered by the SAP Exit, irrespective of whether the filter is used in the WebI report). Even if the filter is flagged as optional at the Universe level, it still behaves as mandatory.
    If each filter becomes mandatory then we'll have to create 16 different Universes (for each optional filter and date combination)! This is not feasible.
    I've seen in other posts that MDX Statements are not currently supported for Universes base on BW and SAP Exit should be utilized.
    So with the existing BO version, is it possible to create optional dynamic date variables or is that a product limitation?
    We are on XI3.1 SP3 FP3.1
    Thanks

    Hi Adam,
    In BEx, I would create this query very easily using the "Amount" key figure twice in my results and restricting each with a different SAP standard out-of-the-box delivered variable. For your reference, the variables in BEx are: 0FPER and 0FYTLFP.
    If I expose these variables in my OLE DB for OLAP query, they are not transfered into the universe, but rather act as filters on the entire universe. I've seen in documentation that only "Ready for Input" variables can be transfered as options into the universe which is not something that I have seen mentioned in this thread.
    >> In the BEx Query you have the option to either make the variable "ready for input" or not. The behavior is the same in Bex or in the Universe / Web Intelligence. "Ready for input" means the user can actually provide an input and without the flag the user can not provide an input. Yes those variables are supported in the Universe.
    Why this is a problem: I can't create separate universes based on potential variable periods that users might want to see. Additionally, many financial reports require concurrent use of these measures in the same report. Also, in reality it's not 2 variables, but dozens.
    >> Which is a decision you make already on the BEx query level. if you decide that the variable is not ready for input then the user can change the timeframe in BEx either.
    Also, I don't have a good way to mimic the standard out-of-the-box functionality given with BEx in BO. If I custom create all my variables in the universe, how do I do a lookup from the system date to the fiscal calendar that is stored on the BW server? In other words, how does BO know which date belongs in which period? (the same would be true with factory calendars for a different functional area).
    >> Variable are created in the BEx query and the Universe will leverage those.
    If you want a dynamic date range then EXIT variable as part of the BEx query - ready for input or not - is the solution.
    regards
    Ingo Hilgefort
    The only work around I can see is to require users to enter the current fiscal period and have the BO reports filter based off that user entered value. This is unfortunate as the entire purpose of SAP Exit variables is to avoid having to require user input at report time.

  • Search 1 d array of dynamic data

    Hi,
    Is there a reason why the 'Search 1 D Array' function doesn't give the expected results when working on Dynamic data?
    I am trying to use one where it's input array comes from a Comparison VI inside a For loop, and so is an array of 0's & 1's.
    The element that I have set it to look for is 0, a Numeric Constant converted to Dynamic Data Type using the Convert to Dynamic Data function.
    It appears to me that regardless of whether the array contains a 0, the output is always -1, which indicates that a 0 was not present.
    Any assistance much appreciated
    Thanks
    Lama

    Stradis,
    Thanks for your reply.
    I am also using LabVIEW 8.2.1
    The reason that I am using Dynamic Data types is because this is what the Comparison VI require as input, and produce as output.
    I am using one Comparison VI to compare some DMM readings against a spreadsheet of expected values, with it set to equal within tolerance and outputting one result per datapoint. This will put a 0 against any DMM reading that falls outside of range.
    I am using a second Comparison VI in a similar way, but set to output one result for all channels to produce an overall pass or fail result (1 or 0) for each sweep of the DMM.
    The DMM is set to measure resistance, 2 wire mode and the two wires are routed through two switching matrixes. I am connecting one of the DMM inputs to the first wire and measuring between it and the remainig wires in turn, via the second switching matrix. This is what I am calling one sweep. I am then moving the first DMM input to the second wire and repeating the sweep, etc.
    Consequently I get a 1 D Array of dynamic data out of my For loop, and I want to search it to see if it contains any 0's, which would indicate an overall fail. I had hoped to use the 'Search 1 D Array' function to do this, and if it returned a -1, to use this as an indication that the equipment under test passed all sweeps of the DMM, but as I said earlier I also get -1 for what should be fail conditions.
    I hope you will forgive the spralling mess that is my code, I know that I need to reduce it to a number of sub VI's etc, but I just wanted to see it work first. Hopefully it is attached,
    Thanks
    Lama
    Attachments:
    DMM & 2 Switch Synchronous Scanning 18.vi ‏646 KB

  • How to get list data to Excel to create chart with date filter?

    Hi all,
    I have to create chart from a custom list in o365 site. There is one column named "Due Date" in my list. I want only those records whose Due Date is today or gone, I mean Due Date <= Today.
    How can do it?
    I have tried following ways.
    I have tried with REST (OData Data Feed) but not able to use Today's date (I mean dynamic) as filter.
    I have tried by Export to Excel my view and it is working but if I am uploading my excel file to o365 and refreshing data connection, it is showing error and not working.
    NOTE : I cannot user Power BI features like Power Query we have not that licences.
    Thanks,
    Ritesh
    Ritesh Goswami

    Hi Ritesh
    Not sure if I understood you correctly but what about creating a calculated field which has an if condition like
    if([Due Date]<=today(), "past", "future"
    and then just filter the 'past' / 'future' column?
    Kind regards,
    https://www.sharepointbay.com

  • How do you save dynamic data type, from the DAQ assistant, for use in Excel or matlab?

    Currently, I have the following basic VI setup to save Data from my PCI6221 Data Aquisition Card.  The problem I'm having is I keep getting the last iteration of the while loop in the measurement file and that's pretty much it.  When I try to index the data leaving the loop it gives me a 2D array of Data which cannot be input into the "Write to Measurement File" VI.  How would I save this to a useful Data/time step format?  I was wondering of a way to continuously collect the Data and then save it in a large measurement file that I would manipulate in Matlab/excel?  Am I using the wrong type of loop for this application?  I also noticed my Dynamic Data array consists of data, time, timestep and then a vector of the data taken.  Is it possible to just get a vector of the time change per sample alongside the data?    Sorry for the barrage of questions but any help would be greatly appreciated, and thanks in advance!
    -Bryan
    Attachments:
    basic DAQ.vi ‏120 KB

    There is a VI in the Express > Signal Manipulation palette called "From DDT" that lets you convert from the Dynamic Data Type to other data types that are more compatible with operations like File I/O....for instance, you could convert your DDT into a 2D array and use the Write To Spreadsheet File.vi.  Just a thought...
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How to queue two waveforms in dynamic data

    I am collecting two waveforms for voltage data via DAQ assistant. The output is dynamic data which I can view as two waveforms via a chart. 
    I am sending the retrived data to a queue for storage until a seperate loop can flush the queue and write the data to a measurement file via the Write to Measurement File vi.
    When I retrive my measurement file only one of the two waveforms have been stored.
    I have troubleshot the issue and have determined the correct data is going into the queue

    I'd recommend posting some code.  Are you passing in the two waveforms to the queue as an array of waveforms, or a cluster of waveforms?  Without seeing the code, it is just a guess as to what is going on.

  • Time stamp from dynamic data

    I trying to write dynamic data to a file using Express VI (Write LabView Measurement file). The dynamic data comes straight from a simulated Signal Express VI. The signal part of the dynamic data is written correctly but the time stamp is what appears to be float counting the seconds since the Write LabView Measurement file Express VI was started.
    I have configured the Simulate Signal VI Time stamp to absolute data and time option.
    This should be dead simple but it just do not work!
    Any suggestion to what I might do wrong?
    I do expect that the time stamp would be written as two columns one for date and one for time.
    Thanks,
    Soren T. Jensen

    The timestamp is written in the header of the file. The time and date entered there is the time and date that you are looking for. The timestamp written next to each piece of data is indead a relative value. It is the delta from the timestamp in the header to the time that datum was collected (created). The reason for this is that timestamps are quite large in bytes, especially if you break out the time and date in strings. Just stamping the header and providing the offsets is much more efficient.
    If you choose to not provide a header, I think that the timestamp will be lost entirely. I think that this is probably wrong, but I am uunsure what should be done to correct it.
    Hope that this helps,
    Bob
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Conditional Sum... dynamic Date range MDX

    Hi
    i had question just now and got the right answer for it. That was great. However, I ran and the result was not right.
    It turned out I can not just sum up sales from the current date to the last date of sales but add one extra condition.
    I have three dimensions: Invoice Date, Licence Start Date, Licence End date. I need to add a condition saying only sales with licence start date is equal or early than current licence end date for the below query.
    I am looking at Filter function in MDX book right now. ahh It's been too long since I used the MDX last time. This is kinda urgent. Any help would be appreciated.
    I have added the condition as follows. It is not right because I got the same result as the first one. It should be less.
    And I think it's because the current member of licence start date for the expired month invoices are not applied right. 
    With member MEASURES.ActiveLicences as 
    sum ( 
    Filter(
    {[License Expiry Date].[FinancialYear].CurrentMember: null },
    ([Licence Start Date].[Financial_Year].CurrentMember <= [License Expiry Date].[FinancialYear].CurrentMember)
    [Measures].[No of Students]
    select {
    MEASURES.ActiveLicences,
    [Measures].[No of Students] } on columns, 
    [License Expiry Date].[FinancialYear].[YY-MMM].members on rows 
    from [Sales];
    from 
    With member MEASURES.ActiveLicences as 
    sum ( 
    {[License Expiry Date].[FinancialYear].CurrentMember: null },
    [Measures].[No of Students]
    select {
    MEASURES.ActiveLicences,
    [Measures].[No of Students] } on columns, 
    [License Expiry Date].[FinancialYear].[YY-MMM].members on rows 
    from [Sales];
    Kind regards

    Hi Sqlma,
    According to your description, you are going to sum the measure for the members with the dondition that licence start date is equal or early than current licence end date for the below query, right?
    In this case, you need filter out the members that licence start date is equal or early than current licence end date for the below query. And then sum the total measures using sum function. I have tested it on my local environment, here is a sample query
    for you reference.
    with set [aa]
    as
    filter
    ([Product].[Product Categories].members,
    [Measures].[Internet Sales Amount]>30000)
    member [measures].[b]
    as
    sum([aa],[Measures].[Internet Sales Amount])
    select {[Measures].[Internet Sales Amount],[measures].[b]} on 0,
    [aa] on 1
    from [Adventure Works]
    where [Date].[Calendar].[Calendar Year].&[2008]
    Regards,
    Charlie Liao
    TechNet Community Support

  • BO Report Mobile - date filter

    Hello!
    I have a report in BO Mobile developed with web intelligence tool with two fields of sales values​​, one daily and one monthly. I'm having the following problem: when I select a specific date to the monthly values ​​are equal to the daily values​​.
    Could someone help me.
    It is possible to apply the date filter, make the monthly accumulated values ​​remain?
    Sincerely.
    Gleziane

    Hi
    At Universe level you can create two measure values like daily sales and MTD monthly sales =@
    suppose say yu run the query on date 19-5-2014
    for First measure daily sales where date =@prompt value (i.e date prompt)
    for 2nd measure Monthly sales where date<=@prompt value AND Month=month(@prompt )
    the above is for MTD
    Hope this helps u
    Thanks & Regards
    Sunil

  • How to implement moving (linear) averaging in a subVI with dynamic data?

    I was wondering how to implement a moving or rolling linear averaging using a subVI on a set of dynamic data coming from the DAQ Assistant or a counter input channel that will be written using the Write to Measurement File VI?  Below is an example of what I mean.
    Solved!
    Go to Solution.

    You could use the MeanPtbyPt vi to give the running average.  Assuming your code snippet is inside a loop, wire an =0? comparison of the iteration number to the initialize input to reset the value and put 25 (or whatever you want) as the sample length.

Maybe you are looking for