Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Aitelli_1976
Contributor
Contributor

sum in script Help

I'm trying how to write this in script.  I have these material numbers and with there kw.  In KPI expression I would like to say if you see these material 120345 say its power_kw is 0.37   

IF [SAP_Material 120345      kw 0.37
IF [ SAP_Material 108374     kw 036


 

6 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Aitelli,

Are you doing this in the script editor? Or in the front-end, where you make your KPI object?

If you are doing this in the front-end, which I guess, then you should change the formula. The formula now will only work in a table.

You can force Qlik to show article 120345 by doing the following:

Sum({$< SAP_Material = {120345}>} kw)

If you don't want a KPI object, which object do you want to use?

Jordy

Climber

Work smarter, not harder
Aitelli_1976
Contributor
Contributor
Author

I have these tables which I created with all the fields. What I need to do is to  create a dashboard which gives the total power kw for the material number which are coming into the data center. The kw data is not there in SAP for the new order arriving, I would like to hard code these numbers in.  Please see attachment

For example: Question 1 :   Quantity 6 x 0.34  power kw = 2.04, I need to write a scrip for this formula. How do that?
Question 2: how do I grand total of the kw my column E

JordyWegman
Partner - Master
Partner - Master

If the information is not available in SAP,  you should create a 'User input' file. This means that you will need a list, just like your attachment.

To do for you:

  1. Import your attachment in the Qlik script.
  2. Link (join) this file to your fact table
  3. Enter formula: Quantity x Power KW as Result
  4. Front end, Sum(Result)

Jordy

Climber

Work smarter, not harder
kaanerisen
Creator III
Creator III

sum(pick(match(SAP_Material,'120345','108374'),0.37,0.36)*Quantity)
Aitelli_1976
Contributor
Contributor
Author

I already have a table  called SAP Purchase Order in my app already which has theses  filter PO no, Sap_po_date, SAP_material_number, SAP Quantity, PO quantity.  Except for the kw. Should I create a separate new table in excel with the material number , kw. to calculate the kw

Aitelli_1976
Contributor
Contributor
Author

Not sure what I'm missing didn't work

sum(pick(match(SAP_material, ‘10048709’,’10048920’,’10045980’,’10048710’,’10048710’,’ 10048951’,’10048952’,‘10048708’,’10048711’,’10048706’,’10048707’,’10045971’,’10048833’)0.34,0.36,0.32,0.34,0.7,0.29,0.34,0.34,0.340.65,0.65)*Quantity