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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add a value on a dimension in a bar chart.

Hi,

I want to add a value on my dimension in a bar chart, not in the script.

For exemple : I want add 1 country on my dimension so i try :

=ValueList('Miami',DimCountry)

but that doesn,'t work.

How have to I make ?

Thanks.

1 Solution

Accepted Solutions
Jason_Michaelides
Partner - Master II
Partner - Master II

You didn't create a variable as I suggested.  you also need to alter the expression to reference the ValueList().

See attached.

View solution in original post

11 Replies
Jason_Michaelides
Partner - Master II
Partner - Master II

Hi,

ValueList() is very picky about what it receives. You need to create a variable, vCountry and set it to (with the equals sign):

='ValueList(' & Chr(39) & 'Miami,' & Chr(39) & Concat(Distinct DimCountry,Chr(39) & ',' & Chr(39)) & ',)'

Then, in the dimension use =$(vCountry)

Hope this helps,

Jason

Jason_Michaelides
Partner - Master II
Partner - Master II

Note: 'amp' was added by my phone when posting this! Ignore them!

Not applicable
Author

thanks for your help but that doesn't work...

other idea ?

thanks.

Jason_Michaelides
Partner - Master II
Partner - Master II

I was on a train when I wrote that and got the syntax wrong!  Sorry...try:

='ValueList(' & Chr(39) & Concat(DISTINCT DimCountry,Chr(39)&Chr(44)&Chr(39)) & Chr(39) & ',' & Chr(39) & 'Miami' & Chr(39) & ')'

Jason

Not applicable
Author

Jason, your soluce are true in an object text but not in a dimension

there are not a solution more simple ?

kind : DimCountry + 'Miami'

Jason_Michaelides
Partner - Master II
Partner - Master II

I have used this successfully in a dimension.  If you can post a sample of your app I can take a look.

Not applicable
Author

for example :

Thanks.

Jason_Michaelides
Partner - Master II
Partner - Master II

You didn't create a variable as I suggested.  you also need to alter the expression to reference the ValueList().

See attached.

Not applicable
Author

Yes i try this but I don't arrive to write this in the script

Thanks a lot you are my rescuer