Hi All, I have a query rule which takes 2 parameters: a start date an

Hi All,

I have a query rule which takes 2 parameters: a start date and an end date. It will give me a list of items that were created between the start date and the end date. For instance if I pass in (2009/5/1) as start date and (2014/2/3) as end date it will give me an accumulation of values that occured between those dates. I would like to group that data by months. For instance how much values were created in the month of January, February, ....etc between the dates I passed in to the query rule. So far I have been able to get a list of dates like (2009/5/1, 2009/5/3, 2009/5/4, 2009/6/14,....) which denotes that during those dates a value was created. But I want to be able to distinguish the count of values that were created in the month of 2009/5 and 2009/6 ,....etc till the end date. My goal is to create a tempo report and inside that I want to create a bar graph with the list of values as data and months/year as the categories. I have been t...

OriginalPostID-106390

OriginalPostID-106390

  Discussion posts and replies are publicly visible

Parents
  • ReduceMonthYear

    =with(
    index: rule!IndexOfMonthYear(ri!accumulator, ri!date),
    newValue: if(
    local!index <> "",
    {
    monthValue: index(index(ri!accumulator, local!index, ""), "monthValue", month(ri!date)),
    yearValue: index(index(ri!accumulator, local!index, ""), "yearValue", year(ri!date)),
    number: tointeger(index(index(ri!accumulator, local!index, 0), "number", 0)) + 1
    },
    {
    monthValue: month(ri!date),
    yearValue: year(ri!date),
    number: 1
    }
    ),
    if(
    local!index <> "",
    updatearray(
    ri!accumulator,
    local!index,
    local!newValue
    ),
    append(
    ri!accumulator,
    local!newValue
    )
    )
    )
Reply
  • ReduceMonthYear

    =with(
    index: rule!IndexOfMonthYear(ri!accumulator, ri!date),
    newValue: if(
    local!index <> "",
    {
    monthValue: index(index(ri!accumulator, local!index, ""), "monthValue", month(ri!date)),
    yearValue: index(index(ri!accumulator, local!index, ""), "yearValue", year(ri!date)),
    number: tointeger(index(index(ri!accumulator, local!index, 0), "number", 0)) + 1
    },
    {
    monthValue: month(ri!date),
    yearValue: year(ri!date),
    number: 1
    }
    ),
    if(
    local!index <> "",
    updatearray(
    ri!accumulator,
    local!index,
    local!newValue
    ),
    append(
    ri!accumulator,
    local!newValue
    )
    )
    )
Children
No Data