Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

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
Honored Contributor

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

Hi Martin,

Did you try below yet:

Untitled.png

Regards,

Sokkorn

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

Try this.

          NullAsValue Vendor;

         

          Set NullValue = 'NULL' ;

          Put this statement in script;

Regards,

Kaushik Solanki

Not applicable

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

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

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

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

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

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

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

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

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

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

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

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

as highlighted above :

My QV Server /Developer are version 11 SR1

Not applicable

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

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)

Community Browser