Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lichang422
Creator
Creator

Could I make 3 table without relation

I made 3 tables and resource is from the same data.

未命名.jpg

Table 1(CNC Status) : Filter the SimpleSignalName = FAN , Bat , Act ....etc

Table 2(Servo Status) : Filter the SimpleSignalName = Amp , Zero , Temp ....etc

Table 3(Spindle Status) : Filter the SimpleSignalName = Spindle , spd  ....etc

未命名.jpg


Original , I think 3 tables are without relation ,When I select someone in table 1

Table 2 and Table 3 data are disapointed.

Maybe you will ask why i don't select at making table,Because I want to make some default data to support customer to select.

So how could i make it without relation??

未命名.jpg

1 Solution

Accepted Solutions
lichang422
Creator
Creator
Author

Oh, MY GOD .

I got it.

Thank you for answering my question so patiently ,Petter

Finally, My result code like below :

QUALIFY *;

[CNC]:


LOAD

   [L1Name],

   [signalname],

   [value],

   [SimpleSignalName]


RESIDENT [L1Signal_Pool_Active] WHERE   WildMatch(SimpleSignalName, '*sig*','*pro*','*comment*','*modal*','*parts*','*time*','*cnc*','*emg*','*mode*','*seq*');




[SV]:


LOAD

   [L1Name],

   [signalname],

   [value],

   [SimpleSignalName]


RESIDENT [L1Signal_Pool_Active] WHERE WildMatch(SimpleSignalName, '*servo*','*pos*','*pulse*','*zero*','*srv*','*apc*');



[SP]:


LOAD

   [L1Name],

   [signalname],

   [value],

   [SimpleSignalName]


RESIDENT [L1Signal_Pool_Active] WHERE WildMatch(SimpleSignalName, '*spdl*','*spindle*','*acts*','*sigenb*');


未命名.jpg


View solution in original post

21 Replies
petter
Partner - Champion III
Partner - Champion III

Can you tell us all of the names of the fields in each of the three tables?

lichang422
Creator
Creator
Author

table 1 (CNC Status) expression :

=if(WildMatch(SimpleSignalName, '*sig*','*pro*','*comment*','*modal*','*parts*','*time*','*cnc*','*emg*','*mode*','*seq*'

),SimpleSignalName)

table 2 (Servo Status) expression :

=if(WildMatch(SimpleSignalName, '*servo*','*pos*','*pulse*','*zero*','*srv*','*apc*'

),SimpleSignalName)

Table 3 (Spindle Status) expression :

=if(WildMatch(SimpleSignalName, '*spdl*','*spindle*','*acts*','*sigenb*'

),SimpleSignalName)

They are all from SimpleSignalName data.

petter
Partner - Champion III
Partner - Champion III

These are the expressions for the measures in your table in the UI.

I was asking about the field names of the three tables in you data model. They determine how the values in various fields are associated (related). Could you please give us the names of all the fields in the three tables. You can find them in the Data Model Viewer. Maybe you can make a screenshot of that and post it here?

ericasense
Contributor III
Contributor III

Hi Shih, the way that the data engine in QlikSense works is that it automatically performs a join in the background on any two fields with exactly the same name.

Eg, if you have two unrelated tables, eg Sales and SafetyIncidents, but they both have a field called [Date], then QlikSense will connect those tables using the field [Date]. Selecting a value in SafetyIncident will filter that table, and then also filter sales for any matching dates.

The solution is to rename any fields that are the same. Easiest way to do this is to go into the data model viewer and look at the connecting lines between the tables, and which fields they are connecting, then go back into the script and rename those fields.

Alternately, you can use the Qualify statement to automatically prefix tablenames to the start of field names. Just type

Qualify *;

before any tables you wish this to apply to, and then after the table has loaded type

Unqualify *;

To ensure it doesn't get applied anywhere else. This will transform all fieldnames into the format Tablename.Fieldname

Erica

lichang422
Creator
Creator
Author

I think i post my qvf , maybe it is quickly to let everyone know my proble

Thanks for everyone reply.

ericasense
Contributor III
Contributor III

Hi Shih, not sure what this is telling me, there only seems to be one table loaded in there?

Are you getting confused between the fields and the tables? And did you want to split the table out into 3 tables, is that what you are trying to do?

Erica

lichang422
Creator
Creator
Author

Yes, this is my problem.

I just only one table loaded.

I want to split it into 3 tables and 3 tables are not any relation(3 tables filters can be selected independly)


Why i don't want to load 3 times??

Because now this data is very small.In the future,the data will become very bigger .(More than 100 thousand)

So if i load 3 times ,it will spend a lot of time.

ericasense
Contributor III
Contributor III

You could load one field each time from SQL?


SQL SELECT L1Name FROM MTLINKi.`L1Signal_Pool_Active`;

SQL SELECT signalname  FROM MTLINKi.`L1Signal_Pool_Active`;

SQL SELECT value  FROM MTLINKi.`L1Signal_Pool_Active`;

Erica

petter
Partner - Champion III
Partner - Champion III

The quickest modification would be to do like this - by adding a new Section at the end of you load script:

2018-01-22 11_40_37-Qlik Sense Desktop.png

I have attached the text also.