2 Replies Latest reply on Oct 6, 2018 3:58 AM by seraj alam

    Filter line graph based on final data point

    Damian McCracken

      Hi All,


      I have a line graph with 300 lines with around 20-30 data points on each line per day. I'm measuring battery discharge over time of multiple devices. I'm filtering my data based on the day and displaying the average discharge rate for that day.


      I'd like to be able to apply a filter which isolates the devices which end the day with a battery value less that 30%. I want to see the discharge value for the entire day for these devices and remove devices from the view which ended the day above 30% charge. I.e. if device ends the day < 30% show device, else hide device.


      I'm struggling to do anything than remove all data points for the entire day where the data is below 30%


      I feel this should be a basic filter, but I can't get my head around it.



        • 1. Re: Filter line graph based on final data point
          seraj alam

          can you please attach the workbook

          • 2. Re: Filter line graph based on final data point
            Jim Dehner

            Good morning

            it is a little difficult to provide a complete solution without seeing your twbx workbook

            conceptually you want to find the value of the avg(Battery PC2) on the last (Max) entry each  day - since Battery PC2) is a calculation finding that value could take different forms


            one way is to find the max time as {fixed day(device time):max(device time)}

            then use a conditional filter           {fixed [device id] : max( if max([device time]) =max( [fixed max device time]) and avg(battery pc2) > .3 then "Keep" else "Hide" end )}

            then set the filter to true  you may need to play with the syntax a bit to make it work




            If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.