Hello Jesse,
here is the detailed explanation and my questions.
I have few metrics, for which I need to create WOW, MOM, QOQ, YOY. I have created it in a single table, such a way that, changing the period in view_type parameter, will change the table to have corresponding values of that period.
Select_ date = ifelse(${viewtype}=‘Week’, minOver(min(truncDate(‘WK’, Date)),[truncDate(‘WK’, Date)])
, ${viewtype}=‘Month’, minOver(min(truncDate(‘MM’, Date)),[truncDate(‘MM’, Date)]),
${viewtype}=‘Quarter’, minOver(min(truncDate(‘Q’, Date)),[truncDate(‘Q’, Date)]),
${viewtype}=‘Year’, minOver(min(truncDate(‘YYYY’, Date)),[truncDate(‘YYYY’, Date)]),minOver(min(Date),[Date]))
here, date is in the format - Aug 13, 2023
ifelse(${viewtype}=‘Week’, periodOverPeriodDifference(ASP,Date, WEEK,1),
ifelse(${viewtype}=‘Month’, periodOverPeriodDifference(ASP,Date, MONTH,1),
ifelse(${viewtype}=‘Quarter’, periodOverPeriodDifference(ASP,Date, QUARTER,1),
ifelse(${viewtype}=‘Year’, periodOverPeriodDifference(ASP,Date, YEAR,1),0))))
when I create table, I should use date. I mean the table now shows the date format as Aug 13, 2023.
Q1. But the end user wants to have week number, when the view type is selected as week, likewise for other periods(month, quarter, year)
Q2. I have Select_ date(date hider) as the filter for the user to select time period. currently, I’m using relative dates. but the user want week number, month number, quarter number, instead of the date. At the same time, I would not want the other logics to be disturbed.
Q3. I’m trying to get wow as seperate column using free form lay out. but I’m able to get the vaues for all the selected period. for example, when I select last 4 weeks in my filter, wow shows for all 4 weeks. but I need wow for the last week. likewise for other periods as well.
Thanks