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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
panipat1990
Creator II
Creator II

Help

Dear Team,

i Stuck  a Requirement.I have data where three field.Sub_CAT_CD and MC_CD AND QTY.

And One Sub_cat_Code Contain many MC_CD.

If i make two table First Sub_cat_cd wise QTY

Second is MC_CD WISE QTY

Simple Expression Sum(QTY)

But when i select any MC_CD Then First Table Should be should Sub_CAT_CD_WISE QTY WHERE Selection MC_CD_EXIST.

For this i am sharing data.kindly help me

20 Replies
techvarun
Specialist II
Specialist II

Sorry, attached a wrong qvw earlier.

panipat1990
Creator II
Creator II
Author

If i Select any MC_CD THEN IN Sub_cat_CD Table Show Sum

Kushal_Chawda

try this

Data:

LOAD MC_CD,

     SUB_CAT_CD,

     QTY

FROM

[Data.xlsx]

(ooxml, embedded labels, table is FINAL);

Left Join

LOAD SUB_CAT_CD,

     sum(QTY) as QTYNEW

Resident Data

Group by SUB_CAT_CD;

Create straight table

Dimension:

MC_CD


Expression:

sum(QTYNEW)

panipat1990
Creator II
Creator II
Author

If i Select any MC LIKE 111010001 Then It Should be Show Sum(QTY) 909.

But in SUB_CAT_WISE Straight itr Should be show 7300.

Sum(QTY) Is same Both of table

panipat1990
Creator II
Creator II
Author

Dear Team,

I made two table.

MC_Wise          Sum(QTY)                              Sub_Cat_Wise                    Sum(QTY)

111010001         909                                          1110100                              7300


If i Select MC_CD THEN IT IS OK For MC_CODE_WISE_TABLE


But In Sub_CAT TABLE IT SHOW THE That Sub_CAT_CD_WISE SUM(QTY) Above i Gave Example

Kushal_Chawda

Data:

LOAD MC_CD,

     SUB_CAT_CD,

     QTY

FROM

[Data.xlsx]

(ooxml, embedded labels, table is FINAL);

Left Join

LOAD SUB_CAT_CD,

     sum(QTY) as QTYNEW

Resident Data

Group by SUB_CAT_CD;

Create 1 straight table

Dimension:

MC_CD


Expression:

sum(QTY)



Straight table 2


Dimension:

SUB_CAT_CD


Expression:

sum(QTYNEW)


effinty2112
Master
Master

Hi Gourav,

what about:

MC_CD sum(QTY) SUB_CAT_CD sum(QTY)
11101000190911101007300
11101000291011101007300
11101000391111101007300

The last column is this expression:

Aggr(NODISTINCT sum({$<SUB_CAT_CD = p({<MC_CD = {$(=concat(MC_CD,','))}>}),MC_CD>}QTY),SUB_CAT_CD)

Cheers

Andrew

effinty2112
Master
Master

Hi Gourav,

This selection of MC_CD shows the table's functionality better:

MC_CD sum(QTY) SUB_CAT_CD sum(QTY)
11101011091911101014570
11101011192011101014570
11101020113211101023711
11101020213311101023711
Kushal_Chawda

I would suggest not to use the complex expression as you can easily group the data in script. Which will make the front expression easy

Data:

LOAD MC_CD,

    SUB_CAT_CD,

    QTY

FROM

[Data.xlsx]

(ooxml, embedded labels, table is FINAL);

Left Join

LOAD SUB_CAT_CD,

    sum(QTY) as QTYNEW

Resident Data

Group by SUB_CAT_CD;

Create the straight table like below

Capture.JPG

panipat1990
Creator II
Creator II
Author

Kindly Send me QVW