8 Replies Latest reply: Oct 19, 2016 10:55 AM by Daniela Lauriano RSS


      Boa Tarde,

      eu tenho 5 tabelas e o relacionamento delas é pelo campo ID e todas tem campo data, eu queria unir todas as datas em um unio calendário para filtro, alguém sabe como me ajudar?



      Daniela Lauriano.

        • Re: Calendario
          Andy Weir

          Create a separate master date field in each of your table loads aliased the same name and Qlik associative data model will do the rest.




              ID AS "Table1Id",


             Table1Date AS "MasterDate",

          .... Rest of your table 1 data

          FROM 'table1'




              ID AS "Table2Id",


             Table2Date AS "MasterDate",

          .... Rest of your table 2 data

          FROM 'table2'



            • Re: Calendario

              mas ai o relacionamento entre as tabelas vai ser pela data? pois eu relaciono elas pelo ID, pois a data é diferente uma da outra.

                • Re: Calendario
                  Andy Weir

                  then create a master calendar of your master date values


                  and wire your table values to it using set analysis.



                  sum({$ <[%MasterDate]=p([%table1Date])>} table1value)

                    • Re: Calendario

                      eu quero unificar as datas para filtro, mas nao usar em formulas de set analysis ex:

                      data tabela 1: 2016/10/10

                      data tabela 2: 2016/10/07


                      Ano: 2016

                      Mês 10

                      dia 7 e 10

                      as datas não tem nada a ver uma com a outra, mas eu gostaria de criar um calendario só quando eu puxar o ID 1 me trazer as datas.

                      deu para entender??

                        • Re: Calendario
                          Andy Weir

                          You have 2 choices.


                          1 you formally relate your dates and let Qlik handle the relationship this requires no set analysis.  You will do this by either naming the date fields in each table the same or if you want to keep the date context in your model create a copy of the date field you want to use and name it a report date.  (This was in my first post) you can then add the reporting date onto the page and filtering on a date will automatically filter all the records in your 5 tables on that date.  Note you can extend the calendar filter by using the Year(), Month(), Day() functions if you want easier date filter groupings.  If you want a range of days then look at creating buckets.


                          2 In my second post I talked about a way you can control the relationship of the dates in your charts and this was by using a bit of set analysis.  Using set analysis allows you to control which of the 5 tables dates to use in a particular chart at a particular time you then wire it up to the Master calendar and the filtering will only then happen on the table data you want it to.


                          I think your answer is in these 2 approaches.