Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have been struggling with this for hours .upon continuous investigations with my problem i could find out few causes for my problem .
I have list box and calendar object.
List box has value Day,MTD,Ytd
Calendar object Sales_date
My requirement is upon selecting particular date i need to know ytd,mtd and day values for that particular date .
Lets Assume i need to find net sales for particular date i.e 2/2/1014.
First i select date and any value from list box (any of the value mtd,ytd,day) then i get the desired result .
for the same date with out changing the date value ,if i select any of list box value then values is the calendar is getting clear.
I need calendar shouldn't be cleared .
Below is my calendar code.
Let varMinDate = Floor(WeekStart(Date#('1-1-2014', 'D-M-YYYY')));
Let varMaxDate = Floor(WeekEnd(Date#('31-7-2015', 'D-M-YYYY')));
Cal:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
left Join(Cal)
load TempDate as DATE_KEY
Resident Cal;
NoConcatenate
Cal_TimeGranule:
Load *, 'YTD' as TimeGranule
Resident Cal where DATE_KEY >= YearStart(TempDate) and DATE_KEY <= TempDate;
//Bringing Accumulated MTD granule
Concatenate
Load *, 'MTD' as TimeGranule
Resident Cal where DATE_KEY >= monthstart(TempDate) and DATE_KEY<=TempDate;
//Bringing Accumulated Day granule
Concatenate
Load * , 'Day' as TimeGranule
Resident Cal
where DATE_KEY=TempDate;
DROP Table Cal;
CAL:
Load
TempDate as CAL_DATE,
Month(TempDate) as SALES_MONTH,
Year(TempDate) as SALES_YEAR,
MonthName(TempDate) as SALES_MONTHNAME,
'Q' & Ceil(Month(TempDate)/3) AS SALES_QUARTER,
DayNumberOfYear(TempDate) as DayNumberOfYear,
Day(TempDate) as DayNumberOfMonth,
DayNumberOfQuarter(TempDate) as DayNumberOfQuarter,
num(Month(TempDate)) as MonthNum
Resident Cal_TimeGranule;
below is my datamodel.
Is there any thing should bne changed at datamodel level
Thanks
Hi All
Is my Datamodel incorrect ?