Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
ha142000
Contributor II
Contributor II

need to create Bar chart but by manipulating data

hi i have this data 

where I have company name and Product count made by them

ha142000_0-1686301319827.png

I Need to get this data In this form 

ha142000_1-1686301396377.png

And Create bar chart for it ,Details in X axis and Countss in Y axis  in Bar chart

.Can any one help me with it 

 

1 Solution

Accepted Solutions
rubenmarin

Hi, you can use a calculated dimension like:

=ValueList('Dim1','Dim2','Dim3'...)

And the expression can check the var as:

Pick(Match(ValueList('Dim1','Dim2','Dim3','Dim4'),'Dim1','Dim2','Dim3','Dim4')
,Count({<Product={1}>}Company)
,Count({<Product={">1<=3"}>}Company)
,Count({<Product={">3<=9"}>}Company)

,Count({<Product={">9"}>}Company)
)

View solution in original post

12 Replies
rubenmarin

Hi, you can use a calculated dimension like:

=ValueList('Dim1','Dim2','Dim3'...)

And the expression can check the var as:

Pick(Match(ValueList('Dim1','Dim2','Dim3','Dim4'),'Dim1','Dim2','Dim3','Dim4')
,Count({<Product={1}>}Company)
,Count({<Product={">1<=3"}>}Company)
,Count({<Product={">3<=9"}>}Company)

,Count({<Product={">9"}>}Company)
)

ha142000
Contributor II
Contributor II
Author

hi ,I need to use valuelist in barchart or in load editor

 

rubenmarin

valuelist is a chart only function.

Use it in a calculated dimension (a dimension that has an expression, not only a field) and in the measure like in the example above.

ha142000
Contributor II
Contributor II
Author

thanks alot it worked 

NiTo
Creator
Creator

Hello Rubenmarin,

I tried the expression but m getting an error: Error in expression: ')' is expected.

I did not made any change to the expression othen than chaning the name of fields.

Help Plz.

Thanks

NiTo
Creator
Creator

Here is the expression that I used.

 

Pick(Match(ValueList('UniqueCompany','CompanyProduct>3','CompanyProdcutsBetween 3 and 9','CompanyProduct>9'),
'UniqueCompany','CompanyProduct>3','CompanyProdcutsBetween 3 and 9','CompanyProduct>9')
,Count({<[Product Count]={1}>}(UniqueCompany))
,Count({<[Product Count]={">1<=3"}>}(CompanyProduct>3))
,Count({<[Product Count]={">3<=9"}>}(CompanyProdcutsBetween 3 and 9))
,Count({<[Product Count]={">9"}>}(CompanyProduct>9))
)

rubenmarin

Hi, the count should be on the company name field

Pick(Match(ValueList('UniqueCompany','CompanyProduct>3','CompanyProdcutsBetween 3 and 9','CompanyProduct>9'),
'UniqueCompany','CompanyProduct>3','CompanyProdcutsBetween 3 and 9','CompanyProduct>9')
,Count({<[Product Count]={1}>}CompanyNameField)
,Count({<[Product Count]={">1<=3"}>}CompanyNameField)
,Count({<[Product Count]={">3<=9"}>}CompanyNameField)
,Count({<[Product Count]={">9"}>}CompanyNameField)
)

And [Product Count] should be the field that stores the number of products of each company

NiTo
Creator
Creator

Hello Rubenmarin.

Thanks for your reply. I made the changs and yes it works. I got the count of products depending upon the classification.

But, I am not getting the total of all the counts, on the top of the column, as u can see in the image attached.

Any suggestion. I am new to qlik sense, so I have got a lots of questions.

Thanks

 

 

rubenmarin

Hi, in the measure three is an option to enable/disable the total row, when enabled there is another option to select the totals formula, instead of 'Automatic' select 'Sum'.