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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to link two tables?

Hello

I've table data as

ItemNoT1Value
1L120
2L130
3L140
4L250
5L260
6L270
7L380

Table1:

Load * from table1.qvd;

Min_Max_Table1:

Load Min(Value) as MinValue,

        Max(Value) as MaxValue

Resident Table1;

- The min and max values  is 20 , 80 respectively.

- In frontend i'll select L2 from T1 listbox then the min and max value should chnage to 50, 60 respectively.

- Due to no link in above tables the values are not changing. To make link b/w two tables I'm taking ItemNo field in second table but it is giving error message while loading application(i.e invalid expression).

How can i over come this?

2 Replies
Anonymous
Not applicable
Author

Hi,

Please try the below code.

Table1:

Load * from table1.qvd;

Min_Max_Table1:

Load Min(Value) as MinValue,

        Max(Value) as MaxValue,

        T1

Resident Table1 Group By T1;

Link the two tables with "T1" field instead of Item No and use the T1 field in the "group by" of second table.

If we didnt include Group By we will get "Invalid Expression" error, it is because if we have a field as well as an aggregate function we should mention the field name in the "group by" part.

Regards,

Leni

Not applicable
Author

My code as per below code. How can i link it. When i keep Group By and loading the application it is closing the application.

T1:

Load * from T1;

//***************Dosing*************************

All_DoseCavityPZ:

LOAD FieldValue('DoseCavityPZ', IterNo()) as DoseCavityPZ

AutoGenerate(1)

While not IsNull (FieldValue('DoseCavityPZ', IterNo()));

INPUTFIELD MinDosing,MaxDosing;

Max_Dosing:

LOAD  Dosing,MinDosing, MaxDosing, MinDosing as MinDosing1, MaxDosing as MaxDosing1;

LOAD

'DoseCavityPZ' as Dosing,

max(DoseCavityPZ) as MaxDosing,

min(DoseCavityPZ) as MinDosing

Resident All_DoseCavityPZ;

DROP Table All_DoseCavityPZ;

All_DosePumpSpdS:

LOAD FieldValue('DosePumpSpdS', IterNo()) as DosePumpSpdS

AutoGenerate(1)

While not IsNull (FieldValue('DosePumpSpdS', IterNo()));

INPUTFIELD MinDosing,MaxDosing;

Max_Dosing:

LOAD  Dosing,MinDosing, MaxDosing, MinDosing as MinDosing1, MaxDosing as MaxDosing1;

LOAD 'DosePumpSpdS' as Dosing,

max(DosePumpSpdS) as MaxDosing,

min(DosePumpSpdS) as MinDosing

Resident All_DosePumpSpdS;

DROP Table All_DosePumpSpdS;