2 Replies Latest reply: Oct 6, 2010 10:10 AM by mdeodhar RSS

    Condition for the Expression


      I am new to Qlikview and Iam trying to create a bar chart. The chart will show months as Dimension. For each month I want to show two bars, one bar for total sales lines during that month and the other bar for sales lines for the future. So I guess that would be two expressions for the chart. For the first expression I am doing Count(SalesLine) but for the other I want to do a conditional count. I want the count of lines where the sales year is > 2010. I tried different ways but cannot make it to work.

      By the way on the same subject, is there a way to have two expressions and make two bars display side by side for each month? or does it have to be alternate display?



        • Condition for the Expression


          Yes its possible use more than one expressions in a chart. Also you can achieve conditional expressions using set analysis.

          I've attached a qvw file. that shows sample solution for your problem.




            • Condition for the Expression

              Hi Thanks for your reply... I used the expression that you provided and was going to test it but I found out something else that is also not working correctly so I have to fix that first..

              I am using a date function to convert julian date (DB2) to MM/DD/YYYY format. For this the following date expression works....


              date (makedate(1900 + floor(QRUPMJ/1000),1,1)+num(right(text(QRUPMJ),3))-1,'MM/DD/YYYY') as SalesDate



              Then based on variable SalesDate I am using functions day & month as.....


              day(SalesDate) as SalesDay,

              month(SalesDate) as SalesMonth

              to get the values for day and month. Somehow these functions are returning incorrect values. So the value in SalesDate is correct but the values in SalesDay and SalesMonth are not correct.


              What am I doing wrong?