Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
Valued Contributor III

Re: char table with calculated dimonsion

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
Valued Contributor III

Re: char table with calculated dimonsion

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

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

Hope this helps.

Re: char table with calculated dimonsion

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

Re: char table with calculated dimonsion

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

Re: char table with calculated dimonsion

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

Re: char table with calculated dimonsion

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.

Community Browser