Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
msawyercke
Creator
Creator

renaming values

Hi,

I have a variable in my data called "Bus. Unit".  There are 3 values business units - 10, 50 and 22.  The variable is part of a larger spreadsheet that loads via data load editor.

I use this field as a selection filter in one of my Sense sheets, but would like to change the business unit values to more meaningful descriptor in the actual filter display, such as:

10 = 'apples'

50 = 'oranges'

20 = 'grapefruit'

How do I accomplish this?  Do I add a command into the data load editor, or someplace else?  What function do I use?

Thanks for your help!!!!!!


Mike

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

LOAD

    Owner,

    "PS #",

    "Legacy  #",

    "Concept CD",

  Pick(Match("Bus. Unit", 10, 50, 20), 'Apples', 'Oranges', 'Grapefruit') as "Bus. Unit",

    "UM Status",

    "Unit Location",

    "Franchisee (If Applicable)",

    "Address Line 1",

    "Address Line 2",

    City,

    State,

    Postal,

    County,

    Country,

    Phone,

    Fax,

    Area,

    Region,

    "Region MGR",

    "Region MGR Phone",

    District,

    "District MGR",

    "District MGR Phone",

    "DMA Name",

    "DMA Description",

    "General Manager",

    "Distribution Center",

    Latitude,

    Longitude,

    "Current Date Time",

    "MBM ID",

    F33

FROM [lib://PS_UNIT_MASTER_QUERIES (ckrcorp_msawyer)/Daily Unit Master Query.xls]

(biff, embedded labels, header is 1 lines, table is [Daily Unit Master Query$]);

View solution in original post

10 Replies
sunny_talwar

What is your script right now??

jpenuliar
Partner - Specialist III
Partner - Specialist III

Try ApplyMap function

ApplyMap ‒ QlikView

msawyercke
Creator
Creator
Author

Hi Sunny - thanks again for your response....

Here is the section of the script that loads this variable...

LOAD

    Owner,

    "PS #",

    "Legacy  #",

    "Concept CD",

   "Bus. Unit",

    "UM Status",

    "Unit Location",

    "Franchisee (If Applicable)",

    "Address Line 1",

    "Address Line 2",

    City,

    State,

    Postal,

    County,

    Country,

    Phone,

    Fax,

    Area,

    Region,

    "Region MGR",

    "Region MGR Phone",

    District,

    "District MGR",

    "District MGR Phone",

    "DMA Name",

    "DMA Description",

    "General Manager",

    "Distribution Center",

    Latitude,

    Longitude,

    "Current Date Time",

    "MBM ID",

    F33

FROM [lib://PS_UNIT_MASTER_QUERIES (ckrcorp_msawyer)/Daily Unit Master Query.xls]

(biff, embedded labels, header is 1 lines, table is [Daily Unit Master Query$]);

sunny_talwar

May be like this:

LOAD

    Owner,

    "PS #",

    "Legacy  #",

    "Concept CD",

  Pick(Match("Bus. Unit", 10, 50, 20), 'Apples', 'Oranges', 'Grapefruit') as "Bus. Unit",

    "UM Status",

    "Unit Location",

    "Franchisee (If Applicable)",

    "Address Line 1",

    "Address Line 2",

    City,

    State,

    Postal,

    County,

    Country,

    Phone,

    Fax,

    Area,

    Region,

    "Region MGR",

    "Region MGR Phone",

    District,

    "District MGR",

    "District MGR Phone",

    "DMA Name",

    "DMA Description",

    "General Manager",

    "Distribution Center",

    Latitude,

    Longitude,

    "Current Date Time",

    "MBM ID",

    F33

FROM [lib://PS_UNIT_MASTER_QUERIES (ckrcorp_msawyer)/Daily Unit Master Query.xls]

(biff, embedded labels, header is 1 lines, table is [Daily Unit Master Query$]);

msawyercke
Creator
Creator
Author

Thank You, Sunni:

I get this error message:

Capture.JPG

msawyercke
Creator
Creator
Author

Never mind - I think it works - I need to overwrite the previous Bus. Unit line...

Thanks!!!!

msawyercke
Creator
Creator
Author

Well, the data loaded via the script, but the Filter Pane for this variable does not display any values - either old or new:

Capture.JPG

sunny_talwar

Can you share the values of Bus. Unit before the pick(match()) transformation?

msawyercke
Creator
Creator
Author

Ok...here is a clip of the raw data:

Capture.JPG

I think I see the problem - formatted as text, with a leading zero...this will change the line in the data load editor?