Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

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

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

View solution in original post

7 Replies
gautik92
Specialist III
Specialist III

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

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

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))

simenkg
Specialist
Specialist

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

Under Presentation, check the "Horizontal" checkbox.

markgraham123
Specialist
Specialist
Author

This works exactly Mr. Singh.

This is really genius thing and awesome.

Thanks a ton.

markgraham123
Specialist
Specialist
Author

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
Specialist
Specialist
Author

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.