Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
table:
date, sales
1/1/15,100
1/3/15,200
1/5/15,300
1/7/15,400.
my requirement is 1/1/15 to 1/3/15 date b/w missing 1/2/15 date same 3 to 5 month 4 month missing
so i want missing date and witch date missing that sales replace previous sales amount.like below table
date, sales
1/1/15, 100
1/2/15,100
1/3/15,200
1/4/15,200
1/5/15,300.
Temp:
Load
Date(Date#(date,'D/M/YY')) as date,
sales
Inline
[
date, sales
1/1/15,100
1/3/15,200
1/5/15,300
1/7/15,400
];
MinMaxDate:
Load min(date) as MinDate, Max(date) as MaxDate Resident Temp;
Let vMinDate = Num(Peek('MinDate',0,'MinMaxDate'));
Let vMaxDate = Num(Peek('MaxDate',0,'MinMaxDate'));
Drop Table MinMaxDate;
Join (Temp)
Load
Date(MonthStart($(vMinDate) + IterNo() - 1)) as date
AutoGenerate 1
While $(vMinDate) + IterNo() - 1 <= $(vMaxDate);
NoConcatenate
Final:
Load
date,
If(IsNull(sales) or Len(Trim(sales))=0, Peek('sales'), sales) as sales
Resident Temp
Order By date;
Drop Table Temp;
Hi,
You can create Date field by
Load
Date(today()-RecNo(),'YYYY-MM-DD') as DataDate
Autogenerate 30;
(it will create 1 month date field)
and use previous() in your set analysis where DataDate not match to your date field,
try it,
Check the qvw