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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
paulm
Contributor III
Contributor III

Calulations within a table with Input Fields

Hi,

I have a normal table (not a chart) where I have a number of normal fields and a few input fields. 

One of the requirements is when a input field is updated the user would like to what difference that makes it makes to a final total.

For example:

Original Value  ||   Input Field  ||  Units  ||     Org Value (Original Value* Units)     ||  Input Field Value  (Input Field * Units)

         7                       8             100                          700                                                               800

The problem I am having is that I cannot do a calcation within the normal like.  Any ideas?  I have to keep it as a normal table as we need to allow the user to update the input fields and this function does not seem to be available in the straight table within the chart.

Any help would be greatly appreciated.

Thanks
Paul

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi Paul,

Table boxes do not allow expressions. Did you try using InputSum() instead of Sum()? It's working fine here.

Hope that helps.

Miguel

View solution in original post

5 Replies
Miguel_Angel_Baeyens

Hi Paul,

Table boxes do not allow expressions. Did you try using InputSum() instead of Sum()? It's working fine here.

Hope that helps.

Miguel

jagannalla
Partner - Specialist III
Partner - Specialist III

I didn't get what you said exactly. If i understood you need to take back of a field. Say for example:

InputField BkOriginalValue;

Load

     OriginalValue,

     OriginalValue as BkOriginalValue

From

Table.

OriginalValue  ||   BkOriginalValue  ||  Units  ||     OriginalValue (OriginalValue* Units)     ||  BkOriginalValue (BkOriginalValue * Units)

7                       8             100                          700                                                               800

Hope it helps you

paulm
Contributor III
Contributor III
Author

Hi Miguel,

I never new you could do it that way!  That worked a treat!

Thank you very much.

Paul

paulm
Contributor III
Contributor III
Author

Hi Miguel,

I was wondering if you could help with something simular to this.

I would like to have as part of the pivot table an option to update all the input fields for everything within that "group" of the pivot.  At the minute, to do this I need to go through every record within the table through VB script.  I will attached it at the end. 

When I have updated the rate through the pivot table and using inputavg, it is lighting quick, but it averages the value out, instead of assigning that value to everyone.  Is there a way of replicating this so that I can update every field within the group?  Hopefully this make some sort of sense, if not I can get an example document together..

VB Script:

sub updateEnergy

  set table = ActiveDocument.GetSheetObject("TB01")

  for n = 1 to table.GetRowCount-1

        'write new value into each row, second column

        table.SetInputFieldCell n-1, 6,  getVariable("v_Edit_Energy")

  next     

end sub

Thanks
Paul

Not applicable

hi miguel,

i used two expression both contains inputsum. and i want in my thrid column=col1 + col 2 but the problem is because of inputsum. i cant add two inputsum.... and i tried it from script also. but i cant is there anyother way to do,.

please reply ASAP.

Regards,

sri