Skip to Content
avatar image
Former Member

How can i filter for the Last complete 12 months

i have a run chart the data for which is updated weekly. When i 'review the chart I want to show only the last 12 consecutive complete months. I need to automate the field but current cant do without manual intervention.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 12 at 10:03 PM

    Hello Tony - if your data source is a BEx query, I would use the standard BEx variables that come with the Query Designer - e.g. last year, last 12 months, etc. Your application will be much faster too as it will process on the backend.

    If your backend isn’t BEx, what is it? Also which version/SP of Lumira are you using?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13 at 01:28 PM

    hi Tammy I'm not sure what a BEx query is. I'm using an excell spreadsheet as a datasource and I have both lumria 1.3 and lumria discovery 2.0 applications to manage.

    Add comment
    10|10000 characters needed characters exceeded

  • Hi,

    You could try this for showing the last 12 months, maybe will help you:

    1. have your months in Descending order in the datasource.

    2. try the following script to show the last 12 months:


    var Months= DS_1.getMembers("0CALMONTH", 240);

    var LastTwelveMonths = [Months[0]];

    var Text = "";

    LastTwelveMonths.pop();

    Months.forEach(function(element, index) {

    if (index == 0 || index == 1 || index == 2 || index == 3 || index == 4 || index == 5 ||index == 6 || index == 7 ||index == 8 || index == 9 ||index ==10 || index == 11)

    {

    LastTwelveMonths.push(element.internalKey);

    Text= element.internalKey + " - " +Text;

    }

    });

    var DATASOURCETOBEFILTERED = [DS_1];

    DATASOURCETOBEFILTERED.forEach(function(element, index) {

    element.setFilter("0CALYEAR", LastTwelveMonths);

    });

    Thanks,

    A.Z.

    Add comment
    10|10000 characters needed characters exceeded