Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
michael_anderse
Contributor II
Contributor II

Beginners qustion (how rename and leaving out values in the data load)

Hi

I'm new to qlik and constantly find new challenges.

hope that someone can help me.

One of my Fields is called:

Vehicle Status

It gives me 4 options

0

1

2

3

Udklip.JPG

How do I change the name of my 4 options?

0 = New Vehicle

1 = Used Vehicle

2 = Demo Vehicle

3 = Customer Vehicle

And how do I leave out one value from the table?

Many thanks

/Michael

1 Solution

Accepted Solutions
marcus_sommer

You could use a pick(match()) function or a mapping-table for it:

...

pick(match([Vehicle Status], 0,1,2,3), 'New', 'Used', 'Demo', 'Customer') & ' Vehicle' as [Vehicle Name]

...

Get started with developing qlik datamodels

- Marcus

View solution in original post

4 Replies
marcus_sommer

You could use a pick(match()) function or a mapping-table for it:

...

pick(match([Vehicle Status], 0,1,2,3), 'New', 'Used', 'Demo', 'Customer') & ' Vehicle' as [Vehicle Name]

...

Get started with developing qlik datamodels

- Marcus

sunny_talwar

You can do this in the script like this:

LOAD [Vehicle Status],

          Pick([Vehicle Status] + 1), 'New Vehicle', 'Used Vehicle', 'Demo Vehicle', 'Customer Vehicle') as New_Vehicle_Status

FROM Source

michael_anderse
Contributor II
Contributor II
Author

Hi Sunny

Thanks for your respons

This is my Script now.

But I am get an error when i try to Load.

Not sure what im doing wrong.

Do you know where my error is?

Udklip1.JPG

Many thanks

/Michael

sunny_talwar

You need to put the code I gave you earlier on top of your current load. Line 2

Add a slight modification

LOAD *,

          [Vehicle Status],

          Pick([Vehicle Status] + 1), 'New Vehicle', 'Used Vehicle', 'Demo Vehicle', 'Customer Vehicle') as New_Vehicle_Status;