Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with units of measure

I have a question regarding units of measure. When my data is being extracted, the unit of measure is in Liters. I want to have a button that allows me to go back and forth between Liters and Barrels.

Can someone help me with this? I have a small sample data set attached.

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.  Used button actions and variables to achieve this.

Regards,

Jagan.

View solution in original post

7 Replies
MarcoWedel

Hi,

one solution:

QlikCommunity_Thread_129436_Pic1.JPG.jpg

hit button to switch between expression groups

QlikCommunity_Thread_129436_Pic2.JPG.jpg

QlikCommunity_Thread_129436_Pic3.JPG.jpg

LOAD Product,

    [Sales Volume (Liters)],

    [Sales Volume (Liters)]/119.240471 as [Sales Volume (Barrels)]

FROM

[http://community.qlik.com/servlet/JiveServlet/download/588342-120095/units%20of%20measure%20sample%2...]

(biff, embedded labels, table is Sheet1$);

hope this helps

regards

Marco

Not applicable
Author

Hi,

You can create a field within your script for the value converted to barrels (check the real conversion factor, below is just a sample):

Sales:

Load Product,

SalesVolumeInLiter,

SalesVolumeInLiter / 20 as SalesVolumeInBarrel

from ...

Then you create an expression for each field and use that in your charts.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.  Used button actions and variables to achieve this.

Regards,

Jagan.

Not applicable
Author

With the inline loads, what happens when I update the data and I don't have the same numbers anymore, will it still work?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Inline load is just some fixed values, if you data is changing frequently put all your values in excel file so that it is easy to update the values.  You can replace Inline with Excel or from database.

For excel use Load statement, if it is from database use SELECT statment.

Regards,

Jagan.

Not applicable
Author

What if I have a third unit of measure to convert to? For example, I want to be able to see it in Liters, Barrels or Gallons

jagan
Luminary Alumni
Luminary Alumni

HI,

Create one more button and change the conversion variable value.  Thats it.

Regards,

Jagan.