Skip to main content
September 8, 2023
Question

I would like to create Quarterly report (areachart) for 12 quarters from now.

  • September 8, 2023
  • 2 replies
  • 0 views

I have starting quarter, ending quarter ,startyear and end year. Need to get the quarter names dynamically in x axsis.

For example,

01-10-2020 (4th quarter) to 08-09-2023(third quarter)

Xaxsis categoreis should be Qtr4,Qtr1 2021, Qtr2,Qtr3,Qtr4,Qtr1 2022,Qtr2,....Qtr3 2023

Please any suggestions.

    2 replies

    stefanhelzle0001
    September 8, 2023

    This requires the plugin "Date and Time Utilities".

    a!localVariables(
      local!start: todatetime(date(2020, 10, 1)),
      local!end: todatetime(date(2023, 9, 8)),
      local!quarters: a!forEach(
        items: enumerate(elapsedmonths(local!start, local!end)),
        expression: if(
          ceiling(month(edate(local!start, fv!item)) / 3) = month(edate(local!start, fv!item)) / 3,
          ceiling(month(edate(local!start, fv!item)) / 3),
          null
        )
      ),
      a!forEach(
        items: reject(isnull(_), local!quarters),
        expression: concat(
          "Qtr",
          fv!item,
          if(
            fv!item = 1,
            " " & year(edate(local!start, fv!index * 3)),
            ""
          )
        )
      )
    )

    September 8, 2023

    yes. it is working fine. Thanks a lot for your help.