Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

How to filter chart by a field value

Hi.

Im quite new to Qlikview, so please bear with me.

I have a chart of categories with comparison values from one year to the next. I've been asked to make 4 of these charts, one for each of our cost centers.

Im having trouble working out where to set the filter for each one.

The comparison chart was created by an outside consultant, so I've just copied it and changed the dimensions to show what I want to show.

Examples of our CostCenter's codes are SINT, STOUR and SSI. What code would I use, and where would I put it to set each table to a specific cost center.

I have attached 3 pictures of how the chart looks, and how the dimensions and expressions are set up.

Thank you.

Chart.jpg

Dimensions.jpg

Expressions.jpg

1 Solution

Accepted Solutions
Not applicable

How to filter chart by a field value

Hi,

then change the calculated dimension i've given earlier since that is for the original requirement/s you asked in your thread^^

I think this is what you need with your additional requirement:

=if(CostCenter = 'SSI' or CostCenter = 'SNI', 'SNZ')

this will combine the data for SSI and SNI and rename its dimension with SNZ

Regards,

Alex

10 Replies
Not applicable

Re: How to filter chart by a field value

Hi,

Is this what you need?

Please see attached

Regards,

Alex

Not applicable

How to filter chart by a field value

Hey,

Thanks for your help, I appreciate it.

Your solution seems to work okay, but for some reason it also brings in alot of strange numbers with no Cost Center (and the figures don't match up with anything either.) Otherwise, every sales figure that has STOUR on it for example matches with what we have in our database for that category. So if I sort it by the CC and then by This Value it looks how it should, except for all the figures at the bottom.

Would you also happen to have the solution for this. You may have also ticked an option to fix this in your example, but I can't manage to see it.

Thanks again for your help.

Other products.jpg

Not applicable

How to filter chart by a field value

Hi,

Please go to Chart Properties > Dimensions tab:

click your dimension (=aggr(only({<CostCenter = {'SINT'}>} CostCenter),CostCenter))

then check "Suppress When Value Is Null"

We always need to check this when we do a calculated dimension because if not, the table/chart will also show values for null dimension

I hope this helped you^^

Regards,

Alex

Not applicable

How to filter chart by a field value

Please Close the thread by selecting a correct answer if your question is answered

Not applicable

Re: How to filter chart by a field value

Hey, thank you so much. That fixed it perfectly.

If you don't mind, I have one very last question please. Our local market sales are a combined total of two different cost centers. Im not very skilled with the coding required for Qlikview, so could you please advise what I need to do to the code to add them together?

I thought using an 'and' statement would work, but it doesn't bring back any data. How should I set it up.

=aggr(only({<CostCenter = {'SNI' and 'SSI'}>} CostCenter),CostCenter)

Thank you

Not applicable

How to filter chart by a field value

Hi,

You mean you want to SNI and SSI as your CostCenter?

try this

=aggr(only({<CostCenter = {'SNI','SSI'}>} CostCenter),CostCenter)

Regards,

Alex

Not applicable

Re: How to filter chart by a field value

Hi.

Thats on the right track, but I need them to be combined as one. So rather than having each category listed once for SSI and once for SNI, I want the figures to be totalled as one Cost Center (maybe called SNZ, or something like that).

Seperated Categories.jpg

Thanks.

Not applicable

How to filter chart by a field value

Hi,

then change the calculated dimension i've given earlier since that is for the original requirement/s you asked in your thread^^

I think this is what you need with your additional requirement:

=if(CostCenter = 'SSI' or CostCenter = 'SNI', 'SNZ')

this will combine the data for SSI and SNI and rename its dimension with SNZ

Regards,

Alex

Highlighted
Not applicable

Re: How to filter chart by a field value

Thank you. That worked perfectly. Everything's looking as it should.