Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expressions

Hi,

I have two tables and would like to use the information from one to the other one.

One table is a reference table.

for Material 1234 1 PC = 10 M, or 1 BOX = 100M

Material NumberNumerat.BUnAUn
1234100MBOX
123410MPC

the other tables is showing information about the agreement we have.

Material NumberBase UnitPO UnitVolume (Base Unit)Net Price
1234MPC7975200,66

Question:

I would like to divide the 'Volume (Base Unit)' with 'Numerat.' if 'AUn' and 'PO Unit' is the same, in this case both have PC

Volume (Base Unit) 7975 should be divided by 10 = 797,5

How should I handle this? either in script or in the expression

Thanks in advance

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Join both the tables by using the below script and calculate the values in the script, so that the chart would load faster.

AgreementsTemp:

LOAD

     *

FROM Agreements;

LEFT JOIN (AgreementsTemp)

LOAD

     MaterialNumber,

     Numerat,
     BUn AS  [Base Unit],

     AUn AS  [PO Unit]

     1 AS Temp

FROM Reference;

Agreements:

LOAD

     *,

     [Volume Base Unit] * Numerat AS NetValue

RESIDENT AgreementsTemp;

DROP TABLE AgreementsTemp;

Hope this helps you.

Regards,

Jagan.


View solution in original post

2 Replies
Not applicable
Author

Hi ,

      Its better to have in Expression of a chart .

Include the MaterialNumber as Dimension and then in the Expression

try to have this

if(AUn=POUnit ,Volume/Numerat)

Please reply me for the same .

//Yusuf

jagan
Luminary Alumni
Luminary Alumni

Hi,

Join both the tables by using the below script and calculate the values in the script, so that the chart would load faster.

AgreementsTemp:

LOAD

     *

FROM Agreements;

LEFT JOIN (AgreementsTemp)

LOAD

     MaterialNumber,

     Numerat,
     BUn AS  [Base Unit],

     AUn AS  [PO Unit]

     1 AS Temp

FROM Reference;

Agreements:

LOAD

     *,

     [Volume Base Unit] * Numerat AS NetValue

RESIDENT AgreementsTemp;

DROP TABLE AgreementsTemp;

Hope this helps you.

Regards,

Jagan.