Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I achieve CurrentFullYear & CurrentFullMonth #90

Closed
ishaqbaig opened this issue Dec 18, 2019 · 1 comment
Closed

How can I achieve CurrentFullYear & CurrentFullMonth #90

ishaqbaig opened this issue Dec 18, 2019 · 1 comment

Comments

@ishaqbaig
Copy link

Dear Rob,
How can I achieve CurrentFullYear & CurrentFullMonth
If I select YTD for 2019 need to get data from 01/01/2019 to 31/12/2019
instead of 01/0/2019 till Today()
Regards
Ishaq

@ishaqbaig
Copy link
Author

ishaqbaig commented Dec 19, 2019

The Above was achieved using the below variables
New Variables were created to achieve this

  • vSetFULLYear - the Full Year based on the selected year/month. Not same as YTD
  • vSetPreviousFULLYear – the Full LAST Year based on the selected year/month. Not LY YTD
  • vSetFULLMonth - The FULL Month based on the selected month
  • vSetFULLPreviousYearMonth - The FULL Month of last Year based on the selected month

//---------------------------------------------------------------------
//Gets Data from 01/01/2019 to 31/12/2019 if the selected year is 2019
//Gets Data from 01/01/2018 to 31/12/2018 if the selected year is 2018
// FULL Year of the Selected year
//---------------------------------------------------------------------
Let $(_fieldPrefix)vSetFULLYearModifier =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'$(_vClearFieldList)
$(_f_MonthSerial) = {"<=@(=$(_qvctemp.vMaxModifier)$(_f_MonthSerial)))"},
$(_fYear) = {"@(=$(_qvctemp.vMaxModifier)$(_fYear)))"}'
);

Let $(_fieldPrefix)vSetFULLYear =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'{$<
@($(_fieldPrefix)vSetFULLYearModifier)

}'
);

//---------------------------------------------------------------------
//Gets Data from 01/01/2018 to 31/12/2018 if the selected year is 2019
// FULL Previous Year of the Selected year
//---------------------------------------------------------------------
Let $(_fieldPrefix)vSetPreviousFULLYearModifier =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'$(_vClearFieldList)
$(_f_MonthSerial) = {"&lt;=@(=$(_qvctemp.vMaxModifier)$(_f_MonthSerial))-12)"},
$(_fYear) = {"@(=$(_qvctemp.vMaxModifier)$(_fYear))-1)"}'
);

Let $(_fieldPrefix)vSetPreviousFULLYear =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'{$<
@($(_fieldPrefix)vSetPreviousFULLYearModifier)

}'
);

//---------------------------------------------------------------------
// Gets data from 01/12/2019 to 31/12/2019 if the selected month is Dec-19
// Whereas MTD gives data from 01/12/2019 to 19/12/2019 (if today is 19/12/2019)
// Full Month Total of the selected month
//---------------------------------------------------------------------
Let $(_fieldPrefix)vSetFULLMonthModifier =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'$(_vClearFieldList)
$(_f_MonthSerial) = {@(=$(_qvctemp.vMaxModifier) $(_f_MonthSerial)))}'
);

Let $(_fieldPrefix)vSetFULLMonth =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'{$<
@($(_fieldPrefix)vSetFULLMonthModifier)

}'
);

//---------------------------------------------------------------------
// Gets data from 01/12/2018 to 31/12/2018 if the selected month is Dec-19
// Whereas Last Year MTD gives data from 01/12/2018 to 19/12/2018 (if today is 19/12/2019)
// Full Month Previous Year Month
//---------------------------------------------------------------------
Let $(_fieldPrefix)vSetFULLPreviousYearMonthModifier =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'$(_vClearFieldList)
$(_f_MonthSerial) = {@(=$(_qvctemp.vMaxModifier) $(_f_MonthSerial))-12)}'
);

Let $(_fieldPrefix)vSetFULLPreviousYearMonth =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'{$<
@($(_fieldPrefix)vSetFULLPreviousYearMonthModifier)

}'
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant