Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
n1ef5ng1
Creator
Creator

How do i display all?

Hi,

Example, I have a field name call City which comprises all the cities all over the world

Firstly, I put this statement on the dimension tab

if(city = 'london','london','Others')

This will tabulate two column, London and Others(All cities exclude London)

However, here is the twist,

My desired output is two columns with London and Others(All including London)

How do I derived this, kinda urgent. Thank you

1 Solution

Accepted Solutions
Not applicable

Try

Dimension : Valuelist('London','Others')

Expression : if(Valuelist('London','Others')='London',

                         sum({<city={'London'}>}field1),sum({<city={'*'}>}field1))

The {'*'} will be all cities where there is a value. {'*'} also excludes nulls from the calculation

Should give you what you looking for mate

Cheers,

Byron

View solution in original post

20 Replies
alexandros17
Partner - Champion III
Partner - Champion III

the first idea I have is:

add another field in the script equal to city, and call it city1 (for example)

then load again and use the second field as another dimesion ... use the condition

if(city = 'london','london',null()) only on the first selection and exclude null values ...

hopemit helps

Not applicable

Hi

if(city = 'london',city,'Others')

this condition gives 2 values for city london and others

if u need these as columns then use pivote table and drag and drop city field on the top of tab.

alexandros17
Partner - Champion III
Partner - Champion III

don't exclude null values, I was wrong ....

the second solutopm, from arya brahma is really good but you have to use a pivot not a straight table

n1ef5ng1
Creator
Creator
Author

Hi ,

thanks for the prompt reply

Yes i am using pivot table, due to the constraint and complexity of the data. I have to use on the dimension tab.

However the above code mention, i would want the 'others' to include 'london' data.

n1ef5ng1
Creator
Creator
Author

Hi ,

thanks for the prompt reply

Yes i am using pivot table, due to the constraint and complexity of the data. I have to use on the dimension tab.

However the above code mention, i would want the 'others' to include 'london' data.

n1ef5ng1
Creator
Creator
Author

Hi ,

thanks for the prompt reply

Yes i am using pivot table, due to the constraint and complexity of the data. I have to use on the dimension tab.

However the above code mention, i would want the 'others' to include 'london' data.

n1ef5ng1
Creator
Creator
Author

Hi ,

thanks for the prompt reply

Yes i am using pivot table, due to the constraint and complexity of the data. I have to use on the dimension tab.

However the above code mention, i would want the 'others' to include 'london' data.

n1ef5ng1
Creator
Creator
Author

Hi ,

thanks for the prompt reply

Yes i am using pivot table, due to the constraint and complexity of the data. I have to use on the dimension tab.

However the above code mention, i would want the 'others' to include 'london' data.

n1ef5ng1
Creator
Creator
Author

*edit am using Pivot table