2 Replies Latest reply: May 16, 2012 6:25 AM by Kristian König RSS

    Add condition to script

    Kristian König

      Hello,

       

      my Name is Kristian and i am new to qlikview.

       

      I ve managed to work some things out by myself but now i need help. I hope to ask in the right place

       

      2 Questions, same case but different approach:

       

      1. Scriptview: My column Item is unique but "WITPRICELI" has more than one variables (A, B, C, ....). Is there a possibility to tell the script: Just give me from the table xxx all unique Items but only variable "A"?

       

      LOAD

           Item,

           WITPRICELI (code?)

      From

      Y:\xxx.xlsx

      (ooxml, embedded labels, table is xxx);

       

      2. Sheetview: I dont change the scriptview and i am going to make a Table Box with the given variables. The Table box is now ugly because for every "unique" Item still pops up 3 times(different variables). Is it possible, and if where, to command the table: show me only variable "A"?

       

      Given table now:

       

      Item xx A

      Item xx B

      Item xx C

      Item xxx A

      ....

       

      Thats what i want:

       

      Item xx A

      Item xxx A

      Item xxxx A

      ...

       

      Thank you in advance for your help.

       

      Greetings,

       

      Kristian

        • Re: Add condition to script
          Jason Michaelides

          Hi Kristian,

           

          Try:

           

          LOAD DISTINCT

               Item,

               WITPRICELI

          From

          Y:\xxx.xlsx

          (ooxml, embedded labels, table is xxx)

          WHERE WITPRICELI = 'A';

           

          Hope this helps,

           

          Jason

           

          EDIT - the following added:

           

          The above code will mean only distinct Item numbers with a WITPRICELI of 'A' will be loaded at all.  If you want to load all data but choose to only display certain rows in a chart table you can remove the DISTINCT and the WHERE clause (all data will now be loaded) and then maybe have a simple listbox of WITPRICELI and select one of them.  You chart and table objects will then only show rows for the value you have selected.

           

          OR!  You can load all data but force a chart to only use rows where WITPRICELI is 'A' by either using a dynamic dimension (e.g. =IF(WITPRICELI='A',Item) or set analysis in your expressions (e.g. Sum({<WITPRICELI={A}>} Sales)