Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

markgraham123
Not applicable

Create a dimension in script for every field

Hi All,

I'm trying to create an individual name in a dimension for every field.

Here is the Example:

  

Product A UnitsProduct B UnitsProduct C UnitsProduct D Units
100200300400

I'm trying to create a new dimension which would have names of the Product mapped to its units value.

                          New Dimension

Product A Units    A

Product B Units    B

Product C Units   C

Product D Units   D

I did it in the front end using Value list , Pick Match.

But i'm trying to do it in script so it can be simple on front end chart.

Any help is highly appreciated.

1 Solution

Accepted Solutions
sunny_talwar
Not applicable

Re: Create a dimension in script for every field

Try something like this:

Test:

CrossTable(Dimension, Value)

LOAD RowNo() as Key,

  *;

LOAD * Inline

[

Product A Units, Product B Units, Product C Units, Product D Units

100,200,300,400

];


Capture.PNG

10 Replies
sunny_talwar
Not applicable

Re: Create a dimension in script for every field

Try something like this:

Test:

CrossTable(Dimension, Value)

LOAD RowNo() as Key,

  *;

LOAD * Inline

[

Product A Units, Product B Units, Product C Units, Product D Units

100,200,300,400

];


Capture.PNG

swuehl
Not applicable

Re: Create a dimension in script for every field

Maybe use

The Crosstable Load

to transform your table, then you can extract your Unit e.g. using

Subfield(FIELDNAME,' ',2) as Unit

markgraham123
Not applicable

Re: Create a dimension in script for every field

Sunny,

Do we have any field count limitations to use cross table?

sunny_talwar
Not applicable

Re: Create a dimension in script for every field

field count limitation? Not sure what you mean? can you elaborate?

markgraham123
Not applicable

Re: Create a dimension in script for every field

Stefan,

I'm new to the advanced concepts of data manipulation.

I really do not understand if u just give a keyword.

Anyways thanks.

markgraham123
Not applicable

Re: Create a dimension in script for every field

Like we have 2 field limitation to use Apply map.

sunny_talwar
Not applicable

Re: Create a dimension in script for every field

I guess you need at least 2 fields for CrossTable to work. Cannot work if you just have 1 field.

markgraham123
Not applicable

Re: Create a dimension in script for every field

Got it.

Thank you Sunny

markgraham123
Not applicable

Re: Create a dimension in script for every field

Sunny,

Is there a chance to rename Dimension and values as other names at a time with Crosstable??

I know we can do it by loading resident in another table.

But just checking