Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I've checked great 'QlikView Components' project. I can see, that it has a set expressions for previous month, previous year and previous quarter. But I can't find anything for:
- previous week
- rolling X days / weeks / months
Also, I can't understand, what is the vSetXXXModifier for? What do they modify and what for?
You're correct that there are no standard set analysis expressions for the previous week. But it's very easy to add:
Take the set modifier for previous month and replace
[_MonthSerial] = {$(=Max({1<_Qvc.DummyField=$(_Qvc.Calendar.v.SelectedFieldList_)>} [_MonthSerial]) - 1)}
with
[_WeekSerial] = {$(=Max({1<_Qvc.DummyField=$(_Qvc.Calendar.v.SelectedFieldList_)>} [_WeekSerial]) - 1)}
There is a rolling12 months set analysis expression. Again the rolling12 modifier can be easily adapted to any number of months. Just change the 11 to the number you need.
For days and weeks you can again take the [_MonthSerial]= {...} part and replace _MonthSerial with _DateSerial respectively _WeekSerial to adapt the expression for days or weeks.
The vSetXXXModifier is the part that overrules the user selections (i.e. modifies the set) to create the set that the calculation in the expression is applied to.
Thanks a lot. But where did you take that source code? The code from latest QvcComponents look like:
// Previous Month To Date
Let $(_fieldPrefix)vSetPreviousMonthMTDModifier =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'$(_vClearFieldList)
$(_f_MonthSerial) = {@(=$(_qvctemp.vMaxModifier) $(_f_MonthSerial)) - 1)},
$(_fDay) = {"<=@(=Day($(_qvctemp.vMaxModifier) $(_f_DateSerial))))"}'
);
Let $(_fieldPrefix)vSetPreviousMonthMTD =
MapSubString('_qvctemp.Calendar.EscapeCharsMap',
'{$<
@($(_fieldPrefix)vSetPreviousMonthMTDModifier)
>}'
);
There is some explanation of the SetXXXModifier in the QVC release notes in the section named "Changes for V6".
Doc for available variables is in the QvcDocumentation.qvw, Detail sheet, select Qvc.Calendar and look in the Variables section.
The generated variables and their values (what Gysbert was copying and modifying) can be seen in the Qv variables overview. (Settings, Variables Overview)