Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following table:
[SLATable]:
Load
Date,
INSTITUTIONAME,
INTSANS,
SL1,
SLA
FROM [lib://myqvd.qvd]
(qvd)
There are some INSTITUTIONNAME & Date combinations that won't always populate records for a given day Ion these dates I would still like records and have the SL1 field and INTSANS field to populate zeros so I have dummy records in order to populate a pivot table with accumulative sums. How would I create dummy records in this case? Thank you.
Hi,
You should use the Cartesian product to generate the missing values. Like below.
Temp:
Load Distinct INSTITUTIONAME
FROM [lib://myqvd.qvd]
(qvd);
Join (Temp)
Load Distinct Date
FROM [lib://myqvd.qvd]
(qvd);
MainTable:
Load INSTITUTIONAME & '-'& Date as Key,
INSTITUTIONAME ,
Date
Resident Temp;
Drop table Temp;
Left join(MainTable)
Load *,INSTITUTIONAME & '-'& Date as Key
FROM [lib://myqvd.qvd]
(qvd);
Hi,
You should use the Cartesian product to generate the missing values. Like below.
Temp:
Load Distinct INSTITUTIONAME
FROM [lib://myqvd.qvd]
(qvd);
Join (Temp)
Load Distinct Date
FROM [lib://myqvd.qvd]
(qvd);
MainTable:
Load INSTITUTIONAME & '-'& Date as Key,
INSTITUTIONAME ,
Date
Resident Temp;
Drop table Temp;
Left join(MainTable)
Load *,INSTITUTIONAME & '-'& Date as Key
FROM [lib://myqvd.qvd]
(qvd);
Hi Kaushik that worked. My pivot table now has an accumulative count where there had been no records before.
Thank you!