8 Replies Latest reply: Dec 7, 2017 7:45 AM by Sunny Talwar RSS

    Line chart selection issue

    Sofia Vaz

      Hi all,

       

      In a line chart, I have 3 lines with this expression:

       

      Count({$<MillAlloc={"x"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

      /(Count({$<MillAlloc={"x"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp))

       

      Where x= ATF , SET or FIG.

       

      I want to see them all when I enter the app, but then I may want to see just MillAlloc=ATF. But I'm can not do it. The other lines doesn't desappear… do you have any idea what can I do?

       

      I cannot use MillAlloc as a 2nd dimension of my chart because I also need to draw a line that will be the average of all MillAllocs..

       

      Thank you!

        • Re: Line chart selection issue
          Sunny Talwar

          May be check if ATF is selected or not...

           

          If(SubStringCount('|' & GetFieldSelections(MillAlloc, '|') & '|', '|ATF|') = 1,

          Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

          /(Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp)))

           

          Do the same for the other two

            • Re: Line chart selection issue
              Sofia Vaz

              I understand what you're trying to do but i didn't want to have the selection on a filter pane done when I open he sheet. Instead, I want the chart to display all lines, but to display only the line of the mill selected when I use the filter pane.

                • Re: Line chart selection issue
                  Sunny Talwar

                  I get it, may be this in that case

                   

                  If(SubStringCount(Concat(DISTINCT '|' & MillAlloc & '|'), '|ATF|') = 1,

                  Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

                  /(Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp)))

                   

                  Where GetFieldSelections only show a value when selected, Concat shows value even if you have no selected anything. So when you open your app, and have nothing selected this would work to show the expression

                    • Re: Line chart selection issue
                      Sofia Vaz

                      It's working! Thank you very much, Sunny!

                      • Re: Line chart selection issue
                        Sofia Vaz

                        Hi Sunny,

                        Once again, thank you for your help yesterday.

                         

                        I have a questions and I think you may help me… Before I start using that if expression, my chart was just showing values until de 48 week, as I define here: AllocWeekYear={"<=$(vLastAllocWeek)"} and the x axis have the same lenght. After added the if expression, the chart started displaying values only until that week but with the  x axis complete (empty from week 49 to 52). 

                         

                        Do you have any idea to limit the x axis lenght until vLastAllocWeek? Thank you very much!

                          • Re: Line chart selection issue
                            Sunny Talwar

                            Add the same set analysis to the Concat function as well

                             

                            If(SubStringCount(Concat({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>} DISTINCT '|' & MillAlloc & '|'), '|ATF|') = 1,

                            Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"},InternalServReadyLateDisp={"Y"}>}InternalServReadyLateDisp)

                            /(Count({$<MillAlloc={"ATF"},AllocWeekYear={"<=$(vLastAllocWeek)"}, InternalServPfeYn={"N"},InternalServExternalPi={"N"}>}InternalServReadyLateDisp)))