21 Replies Latest reply: Jan 25, 2018 3:12 AM by shih li RSS

    Could I make 3 table without relation

    shih li

      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

        • Re: Could I make 3 table without relation
          Petter Skjolden

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

            • Re: Could I make 3 table without relation
              shih li

              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.

                • Re: Could I make 3 table without relation
                  Petter Skjolden

                  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?

              • Re: Could I make 3 table without relation
                Erica Whalley

                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

                • Re: Could I make 3 table without relation
                  shih li

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

                  Thanks for everyone reply.

                  • Re: Could I make 3 table without relation
                    shih li

                    Sorry, In the auto generate section,The content likes below :


                    Unqualify *;


                    [L1Signal_Pool_Active_temp_a9dd18a6-4dfe-37a6-c3c5-fb029afa]:

                    LOAD

                    [L1Name],

                    [signalname],

                    [value],

                    Replace([signalname],'_'&[L1Name],'') AS [SimpleSignalName]

                    RESIDENT [L1Signal_Pool_Active];

                    DROP TABLE [L1Signal_Pool_Active];


                    RENAME TABLE [L1Signal_Pool_Active_temp_a9dd18a6-4dfe-37a6-c3c5-fb029afa] to [L1Signal_Pool_Active];




                    So When I create a new section.

                    QUALIFY *;

                    [CNC]:

                    LOAD

                    [L1Name],

                    [signalname],

                    [value],

                    [SimpleSignalName]

                    FROM

                    [L1Signal_Pool_Active_temp_70ddf4c0-8c06-6a9b-b31e-5ea0adc3]

                    WHERE

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

                    UNQUALIFY *;

                    DROP TABLE [L1Signal_Pool_Active_temp_70ddf4c0-8c06-6a9b-b31e-5ea0adc3];



                    Should I need to change underline same as auto generate section ??

                      • Re: Could I make 3 table without relation
                        Petter Skjolden

                        Sorry - I was a bit too quick... the code should refer to the original table name like this in four different places:

                         

                        QUALIFY *;

                        [CNC]:

                        LOAD

                        [L1Name],

                        [signalname],

                        [value],

                        [SimpleSignalName]

                        FROM

                          [L1Signal_Pool_Active]

                        WHERE

                          WildMatch(CNC.SimpleSignalName, '*sig*','*pro*','*comment*','*modal*','*parts*','*time*','*cnc*','*emg*','*mode*','*seq*');


                        [Servo]:

                        LOAD

                        [L1Name],

                        [signalname],

                        [value],

                        [SimpleSignalName]

                        FROM

                          [L1Signal_Pool_Active]

                        WHERE

                        WildMatch(Servo.SimpleSignalName, '*servo*','*pos*','*pulse*','*zero*','*srv*','*apc*');

                         

                        [Spindle]:

                        LOAD

                        [L1Name],

                        [signalname],

                        [value],

                        [SimpleSignalName]

                        FROM

                          [L1Signal_Pool_Active]

                        WHERE

                          WildMatch(Spindle.SimpleSignalName, '*spdl*','*spindle*','*acts*','*sigenb*');


                        UNQUALIFY *;

                        DROP TABLE [L1Signal_Pool_Active];