Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
KZD
Contributor II
Contributor II

Creating a single dimension(column) using multiple fields

Hi to all,

I'm very new to qliksense world and no other bı tool experience before so I'm seeking help desperately 😊

I want to create a single dimension using multiple fields (two or three field). One field must be under the other.

Lets say: Field1 consists of 3items (red, blue, yellow)

Field 2 consists of 2 items (thin, thick)

I want to form a dimension like below:

Red

Blue

Thin

Thick

Any help will be highly appreciated

Thanks in advance

6 Replies
QFabian
Specialist III
Specialist III

Hi @KZD , you can use the automatic concatenation method, that is creating a new table renaming fields :

Field1:
Load * INLINE [
Field1
red
blue
yellow
];


Field2:
Load * INLINE [
Field2
thin
thick
];


Data:
Load distinct
Field1 as Field
Resident Field1;

Data:
Load distinct
Field2 as Field
Resident Field2;

 

 

QFabian
KZD
Contributor II
Contributor II
Author

Thank you so muchQFabian,

You really light the way and I appreciate it👍

I could actually bring the items (from different fields) one under the other. (Using load*inline) 

My dimension is now as follows:

Red

Blue

Thin

Thick

But when I try to add a measure using Sum (usd_price). Every line brings the total summed price.

I mean it should be like this:

Red.....10 $

Blue...............10$

Thin..................50$

Thick.................100$

But it brings like this:

Red.....170$

Blue..............170$

Thin.................170$

Thick.................170$

How can we fix this?

Thanks again

 

 

 

 

 

 

 

 

 

 

QFabian
Specialist III
Specialist III

If the field 'usd_price' is part of the table which have the Color, it should be like this (IN LINE was just an example) :

Source:
Load 
Field1  as Field, 
usd_price

FROM Your Source1;

Source:
Load 
Field2  as Field, 
usd_price

FROM Your Source2;

 

But it will depend on where is the usd_price field.

QFabian
KZD
Contributor II
Contributor II
Author

I erased the part load*inline but I could not manage to write the script source:... as you suggested.

Im a complete rookie in this and as my last chance I'm adding a picture of an excel sheet that shows what ı want to do. Please look at the pic at attachement.

If we manage this the beers are all from me dear friend.

Best regards

 

 

 

 

 

 

 

 

 

 

 

 

20221214_161510.jpg

deepanshuSh
Creator III
Creator III

Hi,

you need to do it like this, create a new table containing 3 fields; one a key field to link to the original table, second the usd_bky, and third the fields that you want to merge into one. 

the key field would be used to fetch the correct USD value corresponding to the newfield and link to the original table. 

newTable:

Load 

KeyField

URUN_KISA_AD1 as newField1,

usd_Bky as USD_Value

Resident TableName;

 

Concatenate

Load 

Keyfield

Urun_Seviye_GV as newField1,

usd_BKY as USD_Value

resident Tablename;

Trial and error is the key to get unexpected results.
QFabian
Specialist III
Specialist III

Question @KZD , how is the data? for example, in 2 rows, i have :

URUN_KISA_AD1, usd_BKY, URUN_SEVIYE_GV
Thin, 50, red
Thick, 100, blu

So, how do you expect to have diferente values  for usd_BKY?

QFabian