Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Null values not showing in bar chart

I have an expression, which work great, as the bar chart shows all values including null ones in my stated dimension,which is called TRADE_CONDITION_1

The expression is

COUNT({$<Book={'Supranationals - GSL'}>}[Trade Tag])

However, when I add in an an extra set analysis, so as to not show some of the values of the TRADE_CONDITION_1 dimension, the null column disappears!

COUNT({$<TRADE_CONDITION_1-={'IF','ICO','FLT','INT','AD','GP','RN','NCR','BRR','AVP'},Book={'Supranationals - GSL'}>}[Trade Tag])

I have not changed any other settings. 'Supress when value is null' is NOT ticked, nor is 'Supress zero-values' or 'Supress Missing'. And i can't tick 'show all values' because i don't want to see all values.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

I would try this:

COUNT({<Book={'Supranationals - GSL'}>} If(Match(TRADE_CONDITION_1, 'VC','NRR','EL') Or Len(TRADE_CONDITION_1) = 0, [Trade Tag]))

Edit: fixed condition >0 to =0

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Remember that -= is a shortcut, so for example

     {<DIM1 -={'Something'}>} is shorthand for {<DIM1 ={'*'} - {'Something'}>}

So this expression selects all NON-null values and then removes the 'Something' entries.So the nulls are excluded before the -= condition is evaluated.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

You could include the nulls by adding this to the end of your expression:

+ COUNT({<Book={'Supranationals - GSL'}>} If(IsNull(TRADE_CONDITION_1), [Trade Tag]))

Or you could use NULLASVALUE TRADE_CONDITION_1; in your script to make TRADE_CONDITION_1 selectable.The nulls will be replaced by empty strings which will be selected by the 'all' ('*') selection.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Aha. I didn't know that! That explains a lot

So how would i exclude the values i want to, without excluding the null values?

jonathandienst
Partner - Champion III
Partner - Champion III

Perhaps you missed my second post (posted just before your reply) which answers your question.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

This is giving me some funny results, but i think it's almost what i need.

It may actually be easier for me to include the TRADE_CONDITION_1s I want instead of the ones I don't want. but how would I get null values included. Would this work?

COUNT({$<TRADE_CONDITION_1={'VC','NRR','EL',NULL},Book={'Supranationals - GSL'}>}[Trade Tag])

jonathandienst
Partner - Champion III
Partner - Champion III

I would try this:

COUNT({<Book={'Supranationals - GSL'}>} If(Match(TRADE_CONDITION_1, 'VC','NRR','EL') Or Len(TRADE_CONDITION_1) = 0, [Trade Tag]))

Edit: fixed condition >0 to =0

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Yes, this works in conjunction with ticking 'Suppress zero values'!

thanks very much