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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ivandrago
Creator II
Creator II

Concatenation Multiple fact tables different dimensions

Hi,

At the moment I have three fact tables where two of the three would have some kind of relationship i.e the same CustomerID & DateEntered, I would also have a field called [Record Type] which would differentiate what each fact table is as per below:

Fact:

Load

     'Sales' as [Record Type]

     ,OrderId as [PK]

     ,CustomerID

     ,DateEntered

     ,InvoiceDate

     ,Product

     ,Amount as Amount

From [..\Sales.qvd] (QVD);

CONCATENATE

Load

     'Quotes' as [Record Type]

     ,QuoteId as [PK]

     ,CustomerID

     ,DateEntered

     ,LongDescription

     ,QuoteAmount as Amount

From [..\Quotes.qvd] (QVD);

CONCATENATE

Load

     'Schedules' as [Record Type]

     ,SchedueId &'_'&SchedueVisitNo as [PK]

     ,PlaceId

     ,ScheduleDateEntered as DateEntered

     ,SchduleName as EngineerName

From [..\Schdeules.qvd] (QVD)

The Sales and Quotes QVD's come from the same ERP system, the Schedules QVD is coming from a different Application altogether and has no relationship, I know this is a case of a Data Island issue but the end user wants it to be all on one Document.

My question is, should I have the same amount of field names on each QVD and put a default value i.e 'UNKNOWN' if it is a Text Field and 0 if it value? Or does it matter if there are more fields on one qvd than the other qvd when CONCATENATE the qvd's together?

Thanks

2 Replies
devarasu07
Master II
Master II

Hi,

It's not required to keep same amount of field names in each qvd.

You may try like below,  is (SchedueId & '|' & SchedueVisitNo  = CustomerID ?)

Fact:

Load

     'Sales' as [Record Type],

     OrderId as [PK],

     CustomerID,

     DateEntered,

     InvoiceDate,

     Product,

     CustomerID & '|' & Date(DateEntered) & '|' & 'Sales' as CustomerID_DateEntered_Type,

    Amount as Amount

From [..\Sales.qvd] (QVD);

CONCATENATE (Fact)

Load

     'Quotes' as [Record Type],

     QuoteId as [PK],

     CustomerID,

     DateEntered,

     LongDescription,

     CustomerID & '|' & Date(DateEntered) & '|' & 'Quotes' as CustomerID_DateEntered_Type,

     QuoteAmount as Amount

From [..\Quotes.qvd] (QVD);

CONCATENATE (Fact)

Load Schedules' as [Record Type],

     SchedueId &'_'&SchedueVisitNo as [PK],

     PlaceId,

     ScheduleDateEntered as DateEntered,

    SchedueId & '|' & SchedueVisitNo & '|' & Date(Floor(ScheduleDateEntered)) & '|' & 'Schedules' as CustomerID_DateEntered_Type,

     SchduleName as EngineerName

From [..\Schdeules.qvd] (QVD)

Thanks,

Deva

jonathandienst
Partner - Champion III
Partner - Champion III

It is not necessary to have the same field names in all the LOAD statements. For each load, the missing field will be automatically loaded with null values. This normal for a fact table that contains more than one type of value or varying granularity levels (eg budgets values and actual values).

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein