Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bom Calculation

Hi everyone!

I have these two tables:

  table1:

ItemNumberType101_Q101_A102_Q102_ATotal_QTotal_A104_Q104_A201_Q201_A202_Q202_A203_Q203_A
A100P111112823193030120130
A101P1312131326251104020110
A102P23294126012060120
A103P71091216221408015020
B100M1552062530505030
B200M21053074020404030
B300M55247930502020
B400M545510930404050

table2:

 

ItemNumberTypeItemNumberQ
A100PB1001
A100PB2002
A101PB1002
A101PB2001
A101PB3003

the first task which I've done is to calculate the 104_A to 203_A. the second one which is complicated is to calculate the cost of P type through its BOM(table2) . the answer should be like this:

 

ItemNumberTypeItemNumberQTotalA/TotalQCost
A100PB10014.1666674.166667
A100PB20025.71428611.42857
A101PB10024.1666678.333333
A101PB20015.7142865.714286
A101PB30031.285714

3.857143

my QV file is attached here, how to tackle this problem?

16 Replies
Anonymous
Not applicable
Author

my excel file is attached here

Anonymous
Not applicable
Author

No one can help me? any solution?

sunny_talwar

Script

Table:

CrossTable(Transaction, QA)

LOAD ItemNumber,

    [101_Q],

    [101_A],

    [102_Q],

    [102_A],

    Total_Q,

    Total_A,

    [104_Q],

    [104_A],

    [201_Q],

    [201_A],

    [202_Q],

    [202_A],

    [203_Q],

    [203_A]

FROM [6.xlsx]

(ooxml, embedded labels);


FinalTable:

LOAD *,

SubField(Transaction, '_', 1) as Transaction_First_Part

Resident Table;


DROP Table Table;


Table:

LOAD ItemNumber,

    Type,

    ItemNumber1,

    Q

FROM

[6.xlsx]

(ooxml, embedded labels, table is BOM);


Left Join (Table)

LOAD ItemNumber as ItemNumber1,

Transaction as New_Transaction,

QA as New_QA

Resident FinalTable

Where Match(Transaction, 'Total_Q', 'Total_A');

Capture.PNG

Chart expressions

=Sum({<New_Transaction = {'Total_A'}>}New_QA)/Sum({<New_Transaction = {'Total_Q'}>}New_QA)

=Sum({<New_Transaction = {'Total_A'}>}New_QA)/Sum({<New_Transaction = {'Total_Q'}>}New_QA) * Q


Anonymous
Not applicable
Author

Thank you so much, Could you please the QV file?

sunny_talwar

Open this link... it's already attached

Re: Bom Calculation

Anonymous
Not applicable
Author

thank you so much, you are a perfect man in Qlikview, I admire you.

sunny_talwar

thank you for your admiration my friend.

Best,

Sunny