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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple questions

Hi guys

I've only used Qlikview for a couple of days and have no experience in any programming kind of software.

I an pivot table I have several values in one dimension where I only need a few of them to be seen or kepted. Fx a dimension called Country and the values are Germany, Sweden, Norway, Finland etc. But I only need Norway and Finland, how can I do that?

one more thing;

If I want to group them fx, Sweden, Norway and Finland as Nordic, how can that be done?

last thing:

In the pivot I have 2 columns, each with their own title, but need to give them a common heading, how can I do that?

Thank you very much!

Br

Inc

1 Solution

Accepted Solutions
sunny_talwar

To answer you 1st question, there are two approaches you can take

1) Using a calculated diemension

If(Match(Country, 'Germany', 'Sweden'), Country) and then select 'Suppress When Value Is Null' on the dimension tab

This will only include Germany and Sweden within the Country field.


Alternatively, you can tell what doesn't need to be included:

If(NOT Match(Country, 'Norway', 'Finland'), Country) and then select 'Suppress When Value Is Null' on the dimension tab

This will now exclude Norway and Finland and include everything else.

2) Use set analysis

Let's say that the expression you are using is Sum(Sales), to include just Germany and Sweden, you can do this:

Sum({<Country = {'Germany', 'Sweden'}>} Sales)

Or to exclude Norway and Finland, you can do this:

Sum({<Country -= {'Norway', 'Finland'}>} Sales) or Sum({<Country = {'*'} -{'Norway', 'Finland'}>} Sales)

The above two expressions are slightly different, but we can get into those details at a later point

Answer for you 2nd query: Two options

1) Create a new field in the script:

If(Match(Country, 'Sweden', 'Norway', 'Finland'), 'Nordic', Country) as NewCountry

and now you can use this new dimension

2) You can again use a calculated dimension

If(Match(Country, 'Sweden', 'Norway', 'Finland'), 'Nordic', Country)

In general try to avoid calculated dimension as much as possible because they are slower then the other alternatives. So for the above two questions, I would choose option 2 for 1st question and option 1 for 2nd question

I am not sure I understand your 3rd question, would you be able to elaborate?

View solution in original post

8 Replies
Not applicable
Author

Hi

If you want to group dimensions then go to chat - select Pivot Table - Dimensions Tab - Edit Groups - click on New  and then Select Cylic Group as shown below image

Groups.PNG

Regards

sunny_talwar

To answer you 1st question, there are two approaches you can take

1) Using a calculated diemension

If(Match(Country, 'Germany', 'Sweden'), Country) and then select 'Suppress When Value Is Null' on the dimension tab

This will only include Germany and Sweden within the Country field.


Alternatively, you can tell what doesn't need to be included:

If(NOT Match(Country, 'Norway', 'Finland'), Country) and then select 'Suppress When Value Is Null' on the dimension tab

This will now exclude Norway and Finland and include everything else.

2) Use set analysis

Let's say that the expression you are using is Sum(Sales), to include just Germany and Sweden, you can do this:

Sum({<Country = {'Germany', 'Sweden'}>} Sales)

Or to exclude Norway and Finland, you can do this:

Sum({<Country -= {'Norway', 'Finland'}>} Sales) or Sum({<Country = {'*'} -{'Norway', 'Finland'}>} Sales)

The above two expressions are slightly different, but we can get into those details at a later point

Answer for you 2nd query: Two options

1) Create a new field in the script:

If(Match(Country, 'Sweden', 'Norway', 'Finland'), 'Nordic', Country) as NewCountry

and now you can use this new dimension

2) You can again use a calculated dimension

If(Match(Country, 'Sweden', 'Norway', 'Finland'), 'Nordic', Country)

In general try to avoid calculated dimension as much as possible because they are slower then the other alternatives. So for the above two questions, I would choose option 2 for 1st question and option 1 for 2nd question

I am not sure I understand your 3rd question, would you be able to elaborate?

Not applicable
Author

Hi Reddy

Thank for your answer.

I don't want to group several dimensions. I have one dimension - Country, which contains several countries and in that dimesion I want to group fx. Sweden, Norway and Finland as Nordic fx?

Please let me know if you have any questions.

Regards

Not applicable
Author

Hi

As per your first question, you can write a condition on Enable Conditon by selecting your required Dimension and condition there say for example : If(Match(Field1, 'ABC', 'DEF'), Field1)

Note : This works if you are doing filter then above condition works or else you can create Calculated Dimension as suggested by Sunny

Remaining questions are not clear, so elaborate more so that we will help

Not applicable
Author

1st question

It works - thanks!

2nd question

It works as well - thanks again!

3rd question:

This is more a presentation question - i have 2 columns - which have related info - I want to give them a common title/heading. Fx if I have one column called pieces and other column called balance and I know it is bottles I want to add a new heading above the two columns called Bottles.

sunny_talwar

For third use a synthetic dimension or an island table approach mentioned here (in this we have used it for a bar chart, but similar idea can be used to do in a pivot table):

Subtotals and multiple dimensions in a barchart

If this doesn't clarify, provide a sample to help you better

Not applicable
Author

tes2.png

So Sunny, sorry for the late reply!

The thread you referenced to was a bit confusing to me, so I have attached a picture of what I'm asking for.

I need to make a heading/title above the two columns. This one I have attached is done in paint just to show what I'm searching help for.

sunny_talwar

Would you be able to provide few rows of dummy data? I think this sort of thing is best understood when the OP user provides the data as it is easier for you to understand when you look the solution for your own data.

Best,

Sunny