Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New Contributor II

Prev YTD based on selected Month and fiscal year

Hi I am trying to create a script to select the YTD for the previous financial year using getfieldselection function.

If I select April (CalendarMonth) and FY19 (FinYear) I would like to get:

YTD Previous year  = 80,000

At the moment what is happening is:

  • If I used this script: =num(sum({1<FinYear={"$(='FY' & (Right(GetFieldSelections([FinYear]),2)-1))"}, S_PROD_GRP={'Online Saver'}>} Sales),'#,##0') I am getting the sales from July to June of FY18 (135,000) but I need the sales from July to April FY18
  • If I use this script: =num(sum({1<FinYear={"$(='FY' & (Right(GetFieldSelections([FinYear]),2)-1))"}, CalendarMonth={'$(=GetFieldSelections([CalMonth]))'},
    S_PROD_GRP={'Online Saver'}>} Sales),'#,##0')  I am getting the sales for APRIL FY18 only (11,772)

How can I do this script right when I have 2 selections?