Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
jmialoundama
Specialist
Specialist

Problem to get last value with max

Hello,

I've a problem in my script :

TMP_STOCK:

    load

       "Magasin - Code",

       Max(Date("Stock Magasin - Date Photo Stock",'YYYYMMDD')) as "Last photo stock"

    from [$(PathQVD)/DWH\F_ODS_STOCKS_$(vCurrentYear).QVD](qvd)

    where "Magasin - Code"=999

    and Date("Stock Magasin - Date Photo Stock",'YYYYMMDD')< WeekEnd(today(),-1,0)

    Group by

            "Magasin - Code";

          

  Inner join(TMP_STOCK)

  LOAD

   "Magasin - Code",

   sum(Quantité en stock") as "Qty stock"

   from [$(PathQVD)/DWH\F_ODS_STOCKS_$(vCurrentYear).QVD](qvd)

   where "Magasin - Code"=999

   and Date("Stock Magasin - Date Photo Stock",'YYYYMMDD')< WeekEnd(today(),-1,0)

   Group by "Magasin - Code";

Instead to get last value wich is 20180923 49 199 (in yellow) i have the sum total of 2018 (in blue) :

Capture_LI.jpg

0 Replies