Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Two Fact Table

Hi All,

This in QlikView.

I have two Fact table in my model:

Sales: DateKey and Sales

Plan: DateKey, ProductKey and Plan

and we have Product master data table.

My Pivot table should have below fields:

Date, Product Group, Sales and Plan.

If we make concatenate of those two table. Will my purpose be fulfill?

Please suggest.

Thanks,

Sarif

9 Replies
ramasaisaksoft

Sorry Mohammad we didn't understand your requirement properly.

Could you please elaborate/Expand  requirement and specify required output.

mhmmd_srf
Creator II
Creator II
Author

Hello Rama,

We have two Fat Tables. One is Sales and another is Plan.

Sales: DateKey and Sales Value

Plan: DateKey, ProductKey and Plan Value

However in chart we need to show Date, Product, Sales Value and Plan Value. Where Sales Value and Plan Value is coming from two different tables.

So what would be the way to handle this situation.

I was thinking to concatenate two Fact tables. Is it right way?

Please advice.

Thanks,

Sarif

sdmech81
Specialist
Specialist

Yeah,,

Since sales r plans r 2 different entities u can concatenate them..

Something like:

Fact:

load datekey,

        Sales,

     'sales' as salesflag

         ........................

from sales.qvd

concatenate

load datekey,

        Product_key,

       Plan

     'Plan' as PlanFalg

         ........................

From paln.qvd;

Product master:

Load * from product master.qvd..

Product master will asscociate with fact through product_key

Let me know if not clear..

Sachin

sdmech81
Specialist
Specialist

2 flags created i.e salesflag and palnflag will help u while handling In sets..

Sachin

khalander
Creator II
Creator II

Hi,

Instead of concatenate try to join two tables if you have one matching key

mhmmd_srf
Creator II
Creator II
Author

okk... but my understanding is the field name of the flag should be same. Not different like Sales Flag and Plan Flag.

I think it should be only flag.

Is my understanding correct?

Please help.

Thanks,

Sarif

MayilVahanan

Hi Mohammad,

You can go with Join instead of Concatenate..

For your scenario, Flag is not required anymore. Because you have different type of KPI (Plan and Sales).

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sdmech81
Specialist
Specialist

Hi,

In ur case Is that Date_key is the same fr both sales n plan table.

I don't think so bcs in real world scenario sales date and plan table dates r different..

That's why I suggested u the concatenate..If they r the same date u can go ahead with Join.

But do check bfr joining as I don't think its the same date bcs dates r generated ib DB so thr is going to b some difference aswell..If in both fact its the same date then u go ahead with join.

Sachin.

sdmech81
Specialist
Specialist

Better attach sample data so tht ppl can throw their views properly.

Sachin