7 Replies Latest reply: May 21, 2018 5:43 PM by Mikael Scorielle RSS

    QlikSense Dimension: show all user selected values regardless of not having data

    Ann Hoffman



      We are attempting to trend Sales over the past 3 years by period using a line chart.  Unfortunately, when a period has no sales it sorts to the beginning of the chart.  For instance, if there are no sales in periods 5-12, our line chart sorts from 5-12 then 1-4 instead of 1-12 which is what we would want.   It appears this is occurring because we have no period entries for months 5-12 so we have no dimension to sort on.  Is there a way in the sort by expression on the line chart to incorporate the users selections (getuserselections) as the sort order and to show zero when there are no sales for a particular period?  (The years/periods are a filter on the app sheet.) I know how to get the user selections into a variable and into a dimension but I don't know how to use that dimension to sort on the line graph. 


      Get user selections for a full year would look like this: '201801','201802','201803','201804','201805','201806','201807','201808','201809','201810','201811','201812'


      The months with data in the example above are 201801, 201802, 201803, 201804


      Even though the line chart has zero sales entries for all the user's selections, it does not sort correctly since the sort expression in the line chart is based on Year and Month.  We cannot sort by period since we can cross fiscal years in our Year/Period filter.