39 Replies Latest reply: Jul 10, 2015 5:42 AM by Sunny Talwar RSS

    YTD vs LYTD

      Hello Everyone,

       

      I am currently using Qlik Sense, need help on a measurement for YTD and LYTD

       

      At first, I had a measurement like the one below, this shows all FY2015 Sales which is from Oct 1st, 2014 to Sept 30th, 2015, since I have data until today, this works great.

       

      Sum({<[Fiscal_Year]={'$(=Year(Today()))'}>}[NETSALES])

       

       

      But, If I do the LYTD I just add a -1 to Year,

       

      Sum({<[Fiscal_Year]={'$(=Year(Today())-1)'}>}[NETSALES])

       

       

      but if I want to specify the exact same amount of week as of YTD, how can I do this?

       

      Sum({<[Fiscal_Year]={'$(=Year(Today())-1)'},[Fiscal_Week]={Today()}>}[NETSALES]) (I know this expression is wrong, just to give you an idea)

       

      Any help Appreciated

       

       

       

      Below is the Load Script. That I have

       

      Period:

      LOAD

           PeriodId,

           Year,

           Month,

           Day,

           Week_Day,

           Week_Number,

           date(floor(Date),'MM/DD/YYYY'),

           Fiscal_Year,

           'Q'&Fiscal_Quarter,

           Fiscal_Month,

           Fiscal_Week,

      FROM [lib://QVDs_Connection/Periods.QVD]

      (qvd) Where PeriodId>=20131001;

       

      Sales:

      LOAD

          ITEM_ID as "Item ID",

          STORE_ID as "Store ID",

          PERIODID as PeriodId,

          V_ID as "Vendor ID",

          QUANTITY,

          WEIGHT,

          NETSALES,

          DISCOUNT,

          REVENUE,

          DISCOUNT_EMPLOYEE

      FROM [lib://QVDs_Connection/SalesDetails_*.QVD]