Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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'
)
(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
Yes its a good idea, thanks a lot