2 Replies Latest reply: Sep 5, 2016 3:22 AM by Marco Vicariucci RSS

    Calculated Variable

    Marco Vicariucci

      Hi everyone,


      I need a hint about a calculated measure on some specific variables.

      As you can see in the picture, there is a pivot table based on some calculate variables ans a KPI field.

      On the left, in the KPI,  there is the total of  $(operazioniValideTotal), defined as:

      count({<[NomeEsitoOperazione]= {'Successo'}>}  total(IDOPERAZIONE))

      In the  pivot table, the dimensions are "Campagna Master" and "Campagna Sponsor" and the hierarchy is Campagna Master>Campagna Sponsor.


      The first measure (Eventi Elaborati con successo)  is the $(operazioniValide), that is specific for the dimension Campagna Master (red circle) and the campagna Sponsor. The sum of Campagna Sponsor's values are the Campagna Master value.

      The  $(operazioniValide) is defined as:


      count({<[NomeEsitoOperazione]= {'Successo'}>}  IDOPERAZIONE)


      The other Measure (% Carico Attuale) is based on the ratio between the $(operazioniValide) and $(operazioniValideTotal).

      My request is that the measure (% Carico Attuale)  will be based on the specific value of the "campagna Sponsor" measur over the value of their "Campagna Master" value.
      For example: look at the green rectangle.

      This value is based on:

      3/39 = 0.076 (7.6%)

      25/39 = 0.64 (64%)


      I need that this value is :

      3/28 = 0.107 (10,7%)

      25/28 = 0.893 (89.3 %)


      This value will appear only if I selected the "campagna Master" and so Qlik will calculate the $(operazioniValideTotal) based on that selection.