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
Valued Contributor

Need to create a dimension in chart

Hi all,

I'm working on a requirement where i do not have a dimension, but only its values.

For eg: I have Zone1, Zone2, Zone3, and Zone4

I have only numbers in all the 4 fileds.

I did the sum() all the numbers in chart, without dimension, it looks like

Zone1 Zone2 Zone3 Zone4

But i wanna display it like

Zone1

Zone2

Zone3

Zone4

By adding some manual dimension in chart or in script.

Any help will be highly appreciated.

Please find the application attached.

1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: Need to create a dimension in chart

This works -

Load * Inline [

Zone1, Zone2, Zone3, Zone4

1,1,1,1

2,2,2,2

3,3,3,3

4,4,4,4

5,5,5,5

];

Dimension - =ValueList('Zone1','Zone2','Zone3','Zone4')

Expression - pick(match(ValueList('Zone1','Zone2','Zone3','Zone4'),'Zone1','Zone2','Zone3','Zone4'),MaxString(Zone1),MaxString(Zone2),MaxString(Zone3),MaxString(Zone4))

297.PNG

7 Replies
gautik92
Valued Contributor III

Re: Need to create a dimension in chart

Table1:

LOAD

Sum([Zone1 Units])  as Zone1Units,

   Sum(  [Zone 2 Units])  as Zone2Units,

   Sum(  [Zone 3 Units]) as Zone3Units,

   Sum([Zone 4 Units]) as Zone4Units

FROM

bookbook.xlsx

(ooxml, embedded labels, table is Sheet1);

Digvijay_Singh
Honored Contributor III

Re: Need to create a dimension in chart

This works -

Load * Inline [

Zone1, Zone2, Zone3, Zone4

1,1,1,1

2,2,2,2

3,3,3,3

4,4,4,4

5,5,5,5

];

Dimension - =ValueList('Zone1','Zone2','Zone3','Zone4')

Expression - pick(match(ValueList('Zone1','Zone2','Zone3','Zone4'),'Zone1','Zone2','Zone3','Zone4'),MaxString(Zone1),MaxString(Zone2),MaxString(Zone3),MaxString(Zone4))

297.PNG

Digvijay_Singh
Honored Contributor III

Re: Need to create a dimension in chart

Just checked i req that expression needs sum,like that-

pick(match(ValueList('Zone1','Zone2','Zone3','Zone4'),'Zone1','Zone2','Zone3','Zone4'),Sum(Zone1),Sum(Zone2),Sum(Zone3),Sum(Zone4))

bwisenosimenkg
Valued Contributor

Re: Need to create a dimension in chart

Set the "Total mode" under Expressions to No Total.

Under Presentation, check the "Horizontal" checkbox.

markgraham123
Valued Contributor

Re: Need to create a dimension in chart

This works exactly Mr. Singh.

This is really genius thing and awesome.

Thanks a ton.

markgraham123
Valued Contributor

Re: Need to create a dimension in chart

Hi Mr.Kesavan,

Sum() in the background helped me to get the chart in the right format.

Thank you.

Never knew that we can sum() without any dimension and group by.

Learning lot of things as i'm beginner.

Thank You.

markgraham123
Valued Contributor

Re: Need to create a dimension in chart

Hi Mr. Gulbrandesn,

Thank you for your help.

Learnt a new thing that we can use "Horizontal" in the table.

Really inspiring.

Thanks again sir.

Community Browser