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

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

Disregard the null values in expression with dimension limits

Hi,

I have a table,

LOAD * INLINE [

    Country, Sales, Profit

    USA, 10000, 2000

    UK, 9000, 1000

    FRANCE, -, -

    INDIA, 30000, 4000

    PAKISTAN, 3000, 5500

];

Now, i have created a bar chart, with country dimension and sum(sales)/sum(Profit) as expression. I gave the dimension limits to show largest 4 (Uncheck the Show Others option). Now, as France has no values in the sales and profits, i don't need FRANCE to appear in the chart (so, i check the Supress Zero Values option in presentation), instead i need the next country, that is PAKISTAN to appear as 4th bar, when i sort the chart by y value descending.

Any suggestions?

I want the expression to disregard the null values while evaluating the expression for this. Thoughts?

8 Replies
Anonymous
Not applicable
Author

Here is the sample app

hic
Former Employee
Former Employee

You need to post some data. If I load your data and create your bar chart, I get this at first try

Image2.png

France is automatically removed. And that's what you want, or...

HIC

Anonymous
Not applicable
Author

I used the dimension limitations, to show the largest 4 and uncheck the others. Then it is giving only first 3 bars.

Not applicable
Author

Here it is...!

Anonymous
Not applicable
Author

If i have some more data like the below:

LOAD * INLINE [

    Country, Sales, Profit

    USA, 10000, 2000

    UK, 9000, 1000

    FRANCE, -, -

    GERMANY,  2500, 2500

    INDIA, 30000, 4000

    PAKISTAN, 3000, 5500

];

Now i get 0 for GERMANY Sum(Sales)-Sum(Profit) too. So, i need this to appear in the chart as 0 on bar. But, as France doesnot have the data, i don't need France to appear in the chart.


In this case, if we give if(expression<>0, expression), i will miss Germany. I need Germany and don't need France

Not applicable
Author

Here it is....!

Not applicable
Author

Here...!

use 'Set NullInterpret = -;

suheshreddy
Contributor III
Contributor III

Here it is