on 05-16-2019 6:30 PM
Hello Experts,
I am looking for following formulas in IDT and I have a field YYYYMM in mydata model.
YTD-
Previous Year YTD-
Current Month-
Previous Current Month-
Complete year- for example Jan 2018 to Dec 2018
Q1, Q2, Q3, Q4 -
QTD -Quarter to date for example 201904 to 201904
Previous 3 years- 2016, 2017, 2018
Thanks in Advance!
Hi Sam,
I'm not sure I've understood what you mean, but I guess you can easily calculate the values required considering the functions of the underlying DB.
For example, to get the PREVIOUS YTD in SQL Server, the function in IDT could be:
(CAST(CAST(LEFT([YOUR_DATA],4) AS INT) -1 ) AS VARCHAR(4)) + RIGHT([YOUR_DATA],2)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Daniele,
Thanks for the update, I tried what you suggested and it does not parse in IDT.
(CAST(CAST(LEFT([DVR_YearMonth.YearMonth],4) AS INT) -1 ) AS VARCHAR(4)) + RIGHT([DVR_YearMonth.YearMonth],2)
Error::[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'CAST', expected 'AS'.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.