Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a master data (fact table) as follows which I will be showing in one of the report:
Notice No | Part Code | Primary Author | Secondary Author | Start Date | End Date | Description | Remark | Status |
---|---|---|---|---|---|---|---|---|
N1001 | 200 | Josh01 | ||||||
N1001 | 300 | Josh01 | ||||||
N1002 | 400 | Ben03 | ||||||
N1002 | 400 | Ben03 | ||||||
N1002 | 200 | Ben03 | ||||||
N1003 | 500 | Josh01 | ||||||
N1004 | 600 | Ken21 | ||||||
N1004 | 700 | Ken21 | ||||||
N1007 | 600 | Sam31 | ||||||
N1009 | 600 | Sam31 |
From this table I need to show another straight table which will consist of distinct "Notice No" and "Part No" which is most consistent with the field "Notice No". e.g. Notice No N1002 should show me Part Code as 400 as it is most consistent. The output should be like this:
Notice No | Part Code | Primary Author | Secondary Author | Start Date | End Date | Description | Remark | Status |
---|---|---|---|---|---|---|---|---|
N1001 | 200 | Josh01 | ||||||
N1002 | 400 | Ben03 | ||||||
N1003 | 500 | Josh01 | ||||||
N1004 | 700 | Ken21 | ||||||
N1007 | 600 | Sam31 | ||||||
N1009 | 600 | Sam31 |
How to achieve this Data Model in QlikView? What would be the optimize way for this?
Abhijit
What you mean by most consistent here ? Can you elaborate please?
What all your dimensions and what all your expressions here? May be if you can offer some details? May be a sample can also help?
Hi,
Abhijit,
Please give some more details on this
Thanks
Here is my loading script (Data Source also has the same Columns):
[JSR Data]:
LOAD
NOTICE,
PREFIX,
BASE,
SUFFIX,
[PART NAME],
[NOTICE TYPE],
[MODEL YEAR],
[LEAD VEHICLE],
[WERS STATUS],
Date([CAD IN] , 'MM/DD/YYYY') AS [CAD IN],
Date([ENG SO], 'MM/DD/YYYY') AS [ENG SO],
PRIMARY,
DESIGNER,
ENGINEER,
PARTS,
CPSC,
REMARKS,
[ACTIVITY REMARKS],
[CAUSAL FACTOR]
FROM
[JSR_2016-05-26.xlsx]
(ooxml, embedded labels, table is Sheet1);
NOTICE,
[NOTICE TYPE],
[MODEL YEAR], [LEAD VEHICLE], [WERS STATUS], Date([CAD IN] , 'MM/DD/YYYY') AS [CAD IN], Date([ENG SO], 'MM/DD/YYYY') AS [ENG SO], PRIMARY, DESIGNER, ENGINEER, PARTS, CPSC, REMARKS, [ACTIVITY REMARKS], [CAUSAL FACTOR]
How to achieve this?
Abhijit
Hi Sunny.. Please check my reply to latest responder.
Can you share your sample example excel file to work on if possible ?
You can load the 2nd table using NoConcatenate with DISTINCT Notice. Like
FirstLoad:
LOAD ...,
...
FROM
[JSR_2016-05-26.xlsx]
(ooxml, embedded labels, table is Sheet1);
NoConcatenate
2ndLoad:
LOAD DISTINCT NOTICE,
...,
YourFields
FROM
[JSR_2016-05-26.xlsx]
(ooxml, embedded labels, table is Sheet1);
Some further deciphering: "Maximum count" meaning that the record in Table 2 should contain the values for the highest PART CODE. Since you don't show us any actual data, what should happen when this "Maximum Count" occurs more than once (with different values in other fields)?
Hi Peter,
If the maximum count occurs more than once, then it should pick any of that maximum count PART CODE.
Abhijit