Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
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 |
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;
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
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
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
];
I wonder why you are looking to join. Its all 0's that you are adding, isn't it?
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?
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.
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..
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
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
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?