Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to do group by Year which is derived from Date, for some reason, it is not working as expected, getting the same number of rows with date Vs Year. Please advice how can i group the below by Year
TestStg:
LOAD
BrachNumber
,Date(Date#(SoldDateKey,'YYYYMMDD'),'YYYY') AS [SoldDateYear]
,SUM([Unbundled Charge Total Amount]) AS [Unbundled Charge Total Amount]
From Sale.QVD (qvd)
GROUP BY
BrachNumber
,Date(Date#(SoldDateKey,'YYYYMMDD'),'YYYY');
Thank you
Neither Date#() nor Date() change the underlying (numeric) date value, only the way it is formatted. If you're trying to isolate the year from a date try Year(Date) instead. Alternatively, pick out the left(Date,4) from your original text value.
Hi,
can you please explain with an example?