Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

char table with calculated dimonsion

hi all,and happy new years,

i hve this script

load contry,salses

from ..

in the chart table i used for the first dimension the contry, in the expresssion i used the sum(sales),

my prob is: i want to use a calculate dimension for all contries that start by 'a' that's all ,i want to display only calculated values,

but it doesn't work can anyone help me please

6 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

If you are only trying to show values for the countries that start with a, then you can do it with set analysis:

Sum({<country={"=WildMatch(country, 'a*')"}>}Sales)

This only calculates sum of sales for the countries that start with a.

Hope this helps.

sinanozdemir
Specialist III
Specialist III

Or another way to show only countries that start with a in a calculated dimension is:

If(WildMatch(country, 'a*'), country)

Hope this helps.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You won't need a calculated dimension, you can do this using a set analysis expression with a simple search like this:

=Sum({<contry={'a*'}>}Sales)


Set analysis restricts expression outcome to the dimension values you want by reducing the total data set for this object to just the countries whose names start with an 'a'.


Best,


Peter

Not applicable
Author

Thanks for your answer ;

i used this exporession, in the seconed  column of slaes (column of expression) ,, it get it perfectly but it gets all values of the first dimonsion  and it put '-'  in the countries that  doesn't start by 'a' ,

the first column :

i used this scripts :

=Only({<contry={'a*'}>}country)

the second:

=sum({<contry={'a*'}>}Sales)


help me please !

Not applicable
Author

thanks for your answer,

this is just an exemple to do it in my script ,

how i can inject a lotof condition in your expression like :

Only({<sales ={">0"},ID ={'id1','id2','id3'},typeDocument -={'d1','d2','d3'}, PR-={'PE'},type -= {''}>}Document)

thanks

Peter_Cammaert
Partner - Champion III
Partner - Champion III

As I said, you won't need a calculated dimension. Change the calculated dimension back into a simple field name, e.g. contry.

Expressions have a default setting that 0 and NULL values should be suppressed. Leave that setting as is. Since your expression with set analysis will only produce results for countries that start with an 'a', all other countries will be suppressed.