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: 
Not applicable

How to do the calculations between the different dimensions?

Capture2.PNG

Hi all, here above the table. I need to divide per line the quantity of dimension "gp_pr" by the volume of dimension "gp_co".

For now, I can only get the result per plant , which means the global quantity of "gp_pr" and "gp_co".

Please see below the current expressions:
Capture3.PNG

I've attached here the simple qvw and 2 excel files (" Test print" is the database of "quantity" and "mapping" is the result i want to show in report)

Ce message a été modifié par : Q H

5 Replies
swuehl
MVP
MVP

What are dimensions _Print_CO_... resp. _Print_WC ? Fields or calculated dimensions?

If they are fields, you can maybe use the TOTAL qualifier with an appropriate fields list:

=Sum(TOTAL<Plant, _Print_CO_... > Volumes)

resp.

=Sum(TOTAL<Plant, _Print_WC > Volumes)


Not sure if this is what you are looking for. Could you upload a small sample QVW and your desired results as excel or similar?

Not applicable
Author

hi swuehl,

"_Print_CO" and "_Print_WC" come from the same field.

in the field, the éléments present as "32ERF105", "33ERP105"...

To do the caluculation per plant, e.g. volume of "32XXXxxx" divided by the volume of "33XXXxxx", I added a mapping in the script area in order to regroup the elements :

LOAD * INLINE [

_plant, _print_c1, _print_lin1, _print_c2, _print_lin2,

ERF, 33XXXxxx, P-2C, 32XXXxxx, PCO-2C

CUX, 33XXXxxx, P-2C, 32XXXxxx, PCO-2C

... ...

]

Maybe the mapping is not correct?

Not applicable
Author

Hi, I've attached a simpe qvw and 2 excel files : " Test print" is the database and " mapping" is the table i what to show in the report. In the qvw you could see the calculations are done per plant instead of per line. Thanks to let me know if it's not clear.

swuehl
MVP
MVP

Sorry, still unclear to me how you want to do the calculations. Could you explain this in more detail, e.g. for the first line

       

plant codewc1gp_prgp_coquantity gp_prquantity gp_co
A33CUX345PRINT-2CPRCHGOV-2C25950
swuehl
MVP
MVP

This replicates your Mapping table for the two quantitiy columns, though I have no idea if this is correct.

plant code wc1 gp_pr gp_co sum(if(wc1= wc and gp_pr = gp,quantity))sum(if(gp_co = gp and mid(wc,3) = mid(wc1,3) ,quantity))Column(1)/Column(2)
W33WEI042PRINT-2CPRCHGOV-2C82,065,01,2615384615385
33WEI061PRINT-4CPRCHGOV-4C64,074,00,86486486486486
33WEI062PRINT-6CPRCHGOV-6C36,021,01,7142857142857
33WEI063PRINT-6CPRCHGOV-6C54,057,00,94736842105263
33WEI064PRINT-6CPRCHGOV-6C43,022,01,9545454545455
E33ERF105PRINT-2CPRCHGOV-2C28,052,00,53846153846154
33ERF108PRINT-1CFOVPRCHGOV-1CFOV66,044,01,5
A33CUX345PRINT-2CPRCHGOV-2C25,095,00,26315789473684
33CUX363PRINT-4CPRCHGOV-4C27,086,00,31395348837209