15 Replies Latest reply: Jan 3, 2017 5:01 AM by Rafael Salero RSS

    Select a dimension, time

    Rafael Salero

      Hello,

       

      I´m already have a few graphs created that use the dimension time like the years of the data.

       

      This is my model:

      model.PNG

      I would like that when I select "Year" only affect the graph that i want and doesn´t alter the others. And the same for the dimension "accountYear".

       

      Better yet, if possible, then i select the "Year" 2016 also select "accountYear" 2016, and then only affect the graph with the corresponded dimensions.

       

      PS: some graph have the dimension "Year" and others the dimension "accountYear".

       

      What should I do?

        • Re: Select a dimension, time
          AC BC

          Use Alternate States for your filter and chart

          • Re: Select a dimension, time
            Vineeth Pujari

            one option is edit your set expressions to ignore selections on those fields as below

            For example, a chart using dimension accountyear

             

            Count(account_id) >>   CHange to   >> Count( {<Year>} account_id)    << This will ignore selections made on Year Field

             

            use vice versa for chart with Year as Dimension add {<accountYear>} to the set

              • Re: Select a dimension, time
                Rafael Salero

                Its not correct it still change.

                 

                This is my measure:

                Avg(Aggr(Sum( {<Year>} account_time_unit), ticket_id,accountMonth, accountYear ))

                 

                Didn´t to anything

                  • Re: Select a dimension, time
                    Vineeth Pujari

                    Try

                    Avg({<Year,Ticket_create_time>} Aggr(Sum( {<Year,Ticket_create_time>} account_time_unit), ticket_id,accountMonth, accountYear ))

                      • Re: Select a dimension, time
                        Rafael Salero

                        Thankyou, it worked.

                         

                        Capture1.PNG

                        This is the graph, also do you know a way that the selection doesn´t change when i select an accountMonth. So that it doesn´t appear only a dot. I prefer like this, all accountMonth

                        • Re: Select a dimension, time
                          Rafael Salero

                          No need, already figured out:
                          Avg({<Year,ticket_create_time, accountMonth = {$(AllMonths)}>} Aggr(Sum( {<Year,ticket_create_time, accountMonth = {$(AllMonths)}>} account_time_unit), ticket_id,accountMonth, accountYear ))

                           

                          Where AllMonths is 'Jan', 'Fev, ....

                           

                          Thanks anyway

                          • Re: Select a dimension, time
                            Rafael Salero

                            Hello Vineeth Pujari,

                             

                            Thankyou for your help.

                            Now i am trying to replicate your answer to other graphs but i´m not being succesfull, could you explain me the logic behind it?

                             

                            New i´m trying to the Qlik doesn´t do nothing when i select "accountYear" and "accountMonth" to this measure:

                            RangeSum(

                              Above(

                                Count(

                                          {$<status_name = {$(vPendente)},

                                          Month,

                                          Year,

                                          MonthYear = {"$(='<=' & Date(Max(MonthYear), 'MMM-YYYY'))"}>} ticket_id), 0,  RowNo())) * Avg(1)

                             

                            PS: the dimension is "Year"

                              • Re: Select a dimension, time
                                Vineeth Pujari

                                Apply the same set to Avg ()

                                  • Re: Select a dimension, time
                                    Rafael Salero

                                    Sorry i didn´t understand...

                                     

                                    I tried to add

                                    RangeSum(

                                      Above(

                                        Count(

                                                  {$<status_name = {$(vPendente)},

                                                  account_ticket_id,

                                                  accountYear,

                                                  accountMonth,

                                                  Month,

                                                  Year,

                                                  MonthYear = {"$(='<=' & Date(Max(MonthYear), 'MMM-YYYY'))"}>} ticket_id), 0,  RowNo())) * Avg(1)

                                    but it is not the proper way to do it

                                      • Re: Select a dimension, time
                                        Vineeth Pujari

                                        Above(

                                            Count(

                                                      {$<status_name = {$(vPendente)},

                                                      account_ticket_id,

                                                      accountYear,

                                                      accountMonth,

                                                      Month,

                                                      Year,

                                                      MonthYear = {"$(='<=' & Date(Max(MonthYear), 'MMM-YYYY'))"}>} ticket_id), 0,  RowNo())) * Avg({<account year, account month, account_ticket_id>}1)

                                          • Re: Select a dimension, time
                                            Rafael Salero

                                            It doesn´t work. Doesn´t even appear the bar

                                              • Re: Select a dimension, time
                                                Vineeth Pujari

                                                please recheck the field names; I've not used exact field names, as I was typing on phone

                                                 

                                                Above(

                                                    Count(

                                                              {$<status_name = {$(vPendente)},

                                                              account_ticket_id,

                                                              accountYear,

                                                              accountMonth,

                                                              Month,

                                                              Year,

                                                              MonthYear = {"$(='<=' & Date(Max(MonthYear), 'MMM-YYYY'))"}>} ticket_id), 0,  RowNo()) * Avg({<account_ticket_id,              accountYear,accountMonth>}1)

                                                  • Re: Select a dimension, time
                                                    Rafael Salero

                                                    I did this: (inserted the RangeSum), double check the names but still when i select "accountYear" or "accountMonth" the graph changed...

                                                     

                                                    RangeSum(

                                                         Above(

                                                              Count(

                                                                   {$<status_name = {$(vPendente)},

                                                                   Month,

                                                                   Year,

                                                                   account_ticket_id,

                                                                   accountYear,

                                                                   accountMonth,

                                                                   MonthYear = {"$(='<=' & Date(Max(MonthYear), 'MMM-YYYY'))"}>} ticket_id), 0,  RowNo())) * Avg({<account_ticket_id,accountYear,accountMonth>}1)

                                  • Re: Select a dimension, time
                                    S Satti

                                    Hi Rafael,

                                     

                                    use the alternate states,

                                     

                                    or

                                    using Sets:

                                    which dimension you are using the chart, except that and remaining filters u can ignore like below.

                                    sum({<year=,[accountYear]={$}>}sales)

                                     

                                    Regards

                                    Sathish