2 Replies Latest reply: Apr 17, 2018 7:37 AM by Sofia Vaz RSS

    Selections in bar charts

    Sofia Vaz

      Hi all,

       

      I'm working with two stacked bar charts: one for absolute values, other for relative values.

       

      The dimension is weeks for both of them (field name:AllocTransfInsDateWeek) .  When working with the app, the user may want to analyse a specific week different from the current, but for these charts, the requirement is that they keep showing the whole year.

       

      For the first one (abs values) I've used the expression bellow, and when selecting one specif week it keeps showing the whole year.

       

      =Count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'},AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId)

       

      However, for the relative values chart, when selecting one specif week it shows only that week. The expression I'm using is this:

       

      =count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId) / aggr(NODISTINCT count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'},AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId),AllocTransfInsDateWeek)

       

      I've already tried to add a set modifier = 1 but nothing happened. Do you have any idea what I might be doing wrong or how can I solve this?

       

      thank you very much,

       

      Sofia

        • Re: Selections in bar charts
          Sunny Talwar

          Try this

           

          =Count({<AllocTransfMktComm *= -{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd = {'ATF'}, AllocTransfTransfStat *= -{"CANCEL"}, AllocTransfInsDateYear = {"$(=Year(Today()))"}, AllocTransfInsDateWeek = {"<=$(=vCurrentInsDateWeek)"}>} AllocTransfAllocTransfId)

          /

          Only({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>} Aggr(NODISTINCT Count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId), AllocTransfInsDateWeek))