Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ignore nulls from year?

A general query,

I have the code as seen here at script level, which after reloaded gets the year dimension with blanks. I want to get rid of this and not see the blanks at all.

if(year >= '2006' and year <= year(today()), year,'') as year_dim,

Any help is appreciated.

Mady

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Then change your expression to

    if(year >= '2006' and year <= year(today()), year) as year_dim,

    If you notice i have removed the '' from the expression, so now you will not get any null values.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Here is your answer.

    http://community.qlik.com/message/131647#131647

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hello Kaushik,

Thanks for the quick reply, but I have this at the load script level and I dont want to ignore all null values(but only from year dimension), I am aware that we can ignore nulls, when we use this dimension within charts. I have year as a list box selector and it shows blanks which I dont want. Is there any other way to do it?

Thanks Again,

Mady

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Then change your expression to

    if(year >= '2006' and year <= year(today()), year) as year_dim,

    If you notice i have removed the '' from the expression, so now you will not get any null values.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thats what i was looking exactly for. But the strange thing was first I tried the below and it gave an error, that IF should have 2 parameters.... I wasnt sure why it did get me that error message??

if(year >= '2006' , year) as year_dim,

Anyways thanks for your time.

Mady