Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to display a string instead of '-' (null) in Ajax?

Hello,

I have the following data:

section access;

 

Access:

LOAD * INLINE [

ACCESS, USERID, COUNTRY

ADMIN, ADMIN, *

USER, USER_USA, USA

USER, USER_FRANCE, FRANCE

];

 

section Application;

     

Sells:

LOAD * INLINE [

COUNTRY, Vendor, Value

USA, John, 10

FRANCE, Marcel, 20

];

 

CONCATENATE (Sells)

LOAD * INLINE [

COUNTRY, Value

USA, 50

];

In my application, I want to make a chart with the sum of sells by vendor. But when there is no vendor, I'd like to have the string "OTHER VENDOR" instead of "-" (null).

I made a custom dimension:

=if(isnull(Vendor), 'OTHER VENDOR', Vendor)

It works fine in QlikView Desktop:

2013-07-02_172720.png

fine in QlikView Desktop with web view

2013-07-02_172829.png

but when I use a web browser with Ajax, it doesn't work:

2013-07-02_173121.png

If I turn off the section access, it works.

Have I another way of using a string instead of the "-" when null?

I'm using QV server v11 SR 2.

Labels (1)
9 Replies
Sokkorn
Master
Master

Hi Martin,

Did you try below yet:

Untitled.png

Regards,

Sokkorn

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

          NullAsValue Vendor;

         

          Set NullValue = 'NULL' ;

          Put this statement in script;

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

well It's working fine with me both in IE and Ajax.

if still you have the issue you can simple copy your code to backend :

Table:

NoConcatenate

LOAD COUNTRY,

           Value,

if(isnull(Vendor), 'OTHER VENDOR', Vendor) as Vendor

Resident Sells;

DROP Table Sells;

This will work for sure

Not applicable
Author

Presentation --> Null symbol

2 problems with this:

- doesn't work with "bar charts" (I don't find the option in "Presentation" tab)

- can't use a dynamic expression (I can write "OTHERS" but not "=count(something) & ' OTHERS'")

Not applicable
Author

Try this.

          NullAsValue Vendor;

        

          Set NullValue = 'NULL' ;

With this solution, I always have the "NULL" when null.

I have to mix it with

=if(Vendor = 'NULL', 'OTHER VENDOR', Vendor)

as dynamic dimension.

And modify all my statements where I don't want to display the "NULL" vendrors.

But this helps!

Not applicable
Author

well It's working fine with me both in IE and Ajax.

Can you tell me what is your QV server version?

Which web browser do you use?

I think it's a bug in my QV server version, because there is no reason I have something displayed in QV desktop web view and something different in a web browser.

if still you have the issue you can simple copy your code to backend :

It's not an option.

My real application is way more complicated. The dimension that can be null is not linked to the dimension I use in my expression, I can't replace null values by something else, because the values are null because they don't exist.


Not applicable
Author

You can change it to :

NullAsValue Vendor;

        

          Set NullValue = 'OTHER VENDOR' ;

also as you mentioned your application is more complex just select the Charts where you don't want to mention NULL just Select the Dimention and Check option "Supress whn Value is Null" and edit Expression as    if(Vendor<>'OTHER VENDOR', Vendor)

See the attached Screen Shot.

or you can use Sokkorn Cheav (Cambodia) solution option.png

Not applicable
Author

you can represent the values as you want in front End :

as highlighted above :

My QV Server /Developer are version 11 SR1

Not applicable
Author

I tried it with my complex application.

Unfortunately, this doesn't give me the result I expected.

I have a complex model with hierarchy, and it's hard for me to make it simple to pinpoint the problem.

Fact is, sometimes I have null values because the value is empty, sometimes I have null values because the line is missing.

With the "NullAsValue", both are counted as the same, whereas I don't want the missing lines to be counted.

Since rohitkoul don't have the problem with QV server 11 SR 1 and I have it with QV server 11 SR 2, I consider it's a bug.

(different result between QV desktop and Ajax should be considered as a bug)