Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Inputsum doesn't work after joining to another table?

I've created a NewField and used INPUTFIELD in my script in a new table using Inline so that the user can control the values within the NewField, and then I need to join this new field to a table I already have. Problem is when I drop the Temp inline table, then I won't be able to use Inputsum in the front end for the user to input the values in my NewField, not sure how I can fix this?

   MainTable is:

IDCriteriaStepNumbers per each step
2512cri2112
2874cri3211
3290cri123
1249cri134
2840cri316
1295cri217

And this is what I have, when I dont join, the Inputsum works, but after I join it doesnt.

INPUTFIELD NewField;

InputTable:

LOAD * INLINE [

     ID, NewField

    2512, 0

    2874, 0

    3290, 0

    1249, 0

    2840, 0

    1295, 0

];

Join (MainTable)

Load *

Resident InputTable;

Drop Table InputTable;

1 Solution

Accepted Solutions
sunny_talwar

See the data model where I have no joined the InputTable into MainTable and yet created a bar chart with Criteria as dimension and Sum(NewField) as expression

Capture.PNG

View solution in original post

13 Replies
Not applicable
Author

Actually, figured it out:

I have to reverse the join as below and it works

Join (InputTable)

Load *

Resident MainTable;

Drop Table MainTable;

So now my InputTable will be the main one

sunny_talwar

Why don't you do like this instead of joining:

INPUTFIELD NewField;

MainTable:

LOAD *,

  0 as NewField;

LOAD * INLINE [

    ID, Criteria, Step, Numbers per each step

    2512, cri2, 1, 12

    2874, cri3, 2, 11

    3290, cri1, 2, 3

    1249, cri1, 3, 4

    2840, cri3, 1, 6

    1295, cri2, 1, 7

];

sunny_talwar

I wonder why you are looking to join. Its all 0's that you are adding, isn't it?

Not applicable
Author

Well because I already have my MainTable coming from different scripts and files..Do you think it's best if I store my MainTable and then load it again, and with the NewField as 0?

sunny_talwar

You mean that you are joining bunch of other tables to create MainTable? I guess, not really sure what you are doing to create MainTable, but another option is to leave InputTable as a separate table linked on the ID field.

Not applicable
Author

Yes, I need to have it joined to my MainTable because I want to be able to create charts based on the dimensions in the MainTable..

sunny_talwar

You don't need to join just because you have to create a chart where dimension resides in MainTable. If the two tables are implicitly joined (without explicitly using join in the script), you would still be able to create a chart the same way if you join them

sunny_talwar

See the data model where I have no joined the InputTable into MainTable and yet created a bar chart with Criteria as dimension and Sum(NewField) as expression

Capture.PNG

Not applicable
Author

hmm yes got it Sunny! Thanks very much

Now can the same happen when having three tables instead of two, and one  common field (ID) between the three?