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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Schalhas
Contributor
Contributor

Add missing datas at a table

I have a table with missing periods. 200703 and 200709-200710

MONTHSUM:

 

GRP_FIELD

PERIOD

MONTH_END_VALUE

4248/21

200701

1040

4248/21

200702

895

4248/21

200704

750

4248/21

200705

740

4248/21

200706

730

4248/21

200707

710

4248/21

200708

550

4248/21

200711

435

4248/21

200712

315

 

The result should be a table with all periods and for missing values - add the value of the prior period or prior periods.

 

GRP_FIELD

PERIOD

MONTH_END_VALUE

4248/21

200701

1040

4248/21

200702

895

4248/21

200703

895

4248/21

200704

750

4248/21

200705

740

4248/21

200706

730

4248/21

200707

710

4248/21

200708

550

4248/21

200709

550

4248/21

200710

550

4248/21

200711

435

4248/21

200712

315

 

First step was to create a table with all periods:

 

BU_PERIOD:

BUPERIOD

200701

200702

200703

200704

200705

200706

200707

200708

200709

200710

200711

200712

 

 

2nd Step to connect the two tables:

 

TEMP:

LOAD Distinct

GRP_FIELD,

PERIOD

Resident MONTHSUM;

Join(MONTHSUM) LOAD

BUPERIOD as PERIOD

Resident BU_PERIOD;

 

Drop Table TEMP;

 

At this step I still miss the periods.

 

3rd Step: Add missing values in empty fields

 

RESULT:

NoConcatenate

LOAD *,

if(isnull(MONTH_END_VALUE),peek(MONTH_END_VALUE ), MONTH_END_VALUE) as MS_ENDWERT_KUM_1

Resident MONTHSUM order by GRP_FIELD, PERIOD asc;

 

Drop Table MONTHSUM;

Labels (3)
0 Replies