1 Reply Latest reply: Mar 11, 2010 5:43 PM by Oleg Troyansky RSS

    Variable issue

      I have an issue with Variables

      The following is the code to create and populate the variable in the Qlikview Editor

      LET vFinanceYearPeriod = peek('MinFY');

      My issue is that I must use another variable in the "Settings" - "Variables Overview" menu to calculate a Total figure to use in charts and gauges. This new variable call ThisMonthsInvoices will use the previously defined variable vFinanceYearPeriod above as part of its calculation

      sum(if(FinanceYearPeriod = $(vFinanceYearPeriod),GBPAmountInvoice);

      when I use the new variable in my charts I get the value 0.

      In order to prove my sanity I created a temporary table to ensure that there is a matching value in the original table using the code below and it pulls the expected data.

      Temp:

      SELECT CustomerType,
      GBPAmountInvoice,
      resident Transactions

      WHERE FinanceYearPeriod = $(vFinanceYearPeriod);

      As you can see the selection in side the variables if statement is the same as the selection on the load statement for my temporary table but the table load will find the required values whereas the calculation insode the variable will nor find anything.

      I would be grateful if anyone could let me know what I am doing wrong ? I am new to qlikview.