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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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.

11 Replies
Not applicable
Author

I suggest you to create a separate dimension, and use it as the dimension of your table.

Your data :

Data:

load * Inline

[DimCountry, Sales

'New York',1000

'Paris',2000

'Sidney',3000

];

You create a new separated dimension:

FullCountry:

LOAD DISTINCT DimCountry AS FullCountry,

1 AS OriginalCountry

RESIDENT Data;

CONCATENATE (FullCountry)

LOAD * INLINE [

FullCountry, OriginalCountry

Miami, 0

];

I add a flag "OriginalCountry" to know easylly if I deal with a country that comes from the original list, or not.

In my expression, I can make the difference between the country flagged as "original":

if(OriginalCountry = 1,

    sum(if (FullCountry = DimCountry, Sales)),

    'This is another country'

)

2012-05-24_175340.png

(see attached file)

Note that in your calculated dimension for the exemple given with the "concat" and "valuelist", you forgot to suround your expression with a "$(=" and a ")", to ask QV to evaluate the string you created.

But putting it in a variable is far more tidy

Not applicable
Author

Yes its a good idea, thanks a lot