5 Replies Latest reply: Jul 30, 2015 6:28 PM by Kendrick Huynh RSS

    Possible to toggle measurements?

      Hi,

       

      Is it possible to toggle between measures that are directly correlated, such as Price in different currencies?

       

      I have sample table:

       

      [MODEL]          [PRICE EUR]          [PRICE USD]

      product A          47.57                         65.87

      product B          43.74                         60.56

      product C          62.88                         87.06

       

      All charts in the Qlik Sense dashboard currently measure on [PRICE USD]. Is there a way to set a filter/button to substitute [PRICE USD] for [PRICE EUR] in all instances that this measurement is used?

       

      Thanks,

      Kendrick

        • Re: Possible to toggle measurements?
          Chris Cammers

          I would use a variable too but differently,

           

          Create an Island table in your data model with one row for each currency you want to include.

          I'll use th field name CurCode

           

          set the value of a variable as follows

           

          Set vVar = =Minstring(CurCode);

           

          Then place your CurCode field on a sheet

           

          In the expressions of your chart you will reference the variable to switch dimensions and expressions across the application.

           

          I'm uploading a sample to give you a better idea but an important note, when I wrote this it was not possible to limit selections on a field to only one value so I used Minstring in the variable to make sure the charts don't go blank when more than one value is available. !

          • Re: Possible to toggle measurements?
            Michael Tarallo

            Hi Kendrick, something like this?

             

             

            Please see the attached video and sample.

             

            Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

             

            Regards,

            Mike Tarallo

            Qlik

            • Re: Possible to toggle measurements?

              Hi Michael,

               

              So it is possible to achieve what I want to do by editing each and every expression of my charts with an IF statement.

              But most of the expressions already contain IF statements, which result in nested IFs.

               

              For example: If([Currency] = 'EUR', If(GetSelectedCount(PERIOD) = 0, '-', Sum({$<BRAND = {'SAMPLE'}>}[SALES VALUE EUR])), If(GetSelectedCount(PERIOD) = 0, '-', Sum({$<BRAND = {'SAMPLE'}>}[SALES VALUE USD])))

               

              I'm wondering if there's a way to consolidate this process by setting something in the Load Editor so that it affects all sheets in the app - something along the lines of:

               

              If [Currency] = 'EUR', replace all metrics using [SALES VALUE USD] and [PRICE USD] with [SALES VALUE EUR] and [PRICE EUR], otherwise stick with [SALES VALUE USD] and [PRICE USD]

               

              Thanks