Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gkcchowdary
Creator
Creator

solve the below req?

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.

3 Replies
MK_QSL
MVP
MVP

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;

tyagishaila
Specialist
Specialist

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,

kavita25
Partner - Specialist
Partner - Specialist

Check the qvw