# Qlik Sense App Development

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for
Did you mean:
Contributor III

## Extract values in special fields

Hello,

I need your help to manage special case found.

In database my field store numbers like 1, 2, 33, 1027.....

In fact, each 2^x represent specific value.

For example:

2^0=1 --> blue car

2^1=2 --> red car

2^2=4 --> orange car

.....

For a customer, this field stores any cars they have. If they have a blue car, value is simple: 1. If a customer have 2 cars, the value is the sum of the two values (example: 6 for a red and orange car). I have lots of combination so it seems impossible to create a pick/match function.

Do you have any idea to extract each single result (cars) in this example please ?

Regards

Regis

Labels (2)

• ### Script

1 Solution

Accepted Solutions
Contributor III
Sounds grenat
Thanks a lot
13 Replies
Partner
Not 100 % clear. i am assuming you get x (in the 2^x) from your data.
Did you try creating a map and applymap for blue/orange thing
MVP

So, if a customer has a value of 4... does it mean that he has  3 cars (2 blue and 1 red) or 2 cars (2 red) or 1 car (1 orange)? if the value is summed, how will you differentiate?

Contributor III

that's not possible with map/applymap because when 2 values summed in the field the maping can't match each individual values

Example:

red car =1

blue car=2

myfield value is 3 and i need to retrieve the two values

Contributor III
Hopefully we only have an value maximum by type
If we have 3 cars there's only 1 of each color
For this example: 3 cars (red=2^0=1, orange=2^1=2, green=2^2=4) my fiedl value will be 4+2+1=7
MVP

Are you saying that you would know in advance how many cars each one of them have?

Contributor III
In fact, with the field value, I need to extract which car the person have
value 7 -> 3 cars: 1 red, 1 orange, 1 green
value 1 -> 1 car: 1 red
MVP

But value 7 can also mean 4 cars = 1 orange and 3 blue cars, isn't it?

MVP

I guess if I see a value, how do I know what makes it up... is it 4+2+1 or is it 4+1+1+1 or 2+2+2+1 or 2+1+1+1+1+1?

Contributor III
Hopefully not 🙂
Only 1 color by car in a field line
Tags