Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rvijayanth
Creator
Creator

In Qliksense, can we show '0' instead of '-' in pivot tables when there are no such records?

In Qliksense, in pivot tables, instead of '-'s, can we show '0's in place of null records?

For example, we have a pivot table with dimensions Year and Category and Count as measure.

Consider this data set:

Counts for 2016 for Category A is 10, B is 2 and C is 7

Counts for 2015 for Category A is   6, B is 3 and C is 0 (since category was established only in 2016)


So our pivot table shows this:


Year             Category A      Category B        Category C


2016                           10                   2                       7 

2015                            6                    3         -


Instead, I want it to be like this: See how for 2015, category C says 0 instead of '-'


Year             Category A      Category B        Category C


2016                         10                    2                       7 

2015                           6                    3                       0


How to accomplish this?

24 Replies
rvijayanth
Creator
Creator
Author

this is what I'm using and Im still getting "-" in place of no countsDash Issue.JPG

If(IsNull(Count(Distinct [Version ID])), 0, Count(Distinct [Version ID]))

Please help:

rvijayanth
Creator
Creator
Author

its in Qliksense. Not QV

Gysbert_Wassenaar

My mistake. Post a small qlik sense app then.


talk is cheap, supply exceeds demand
rvijayanth
Creator
Creator
Author

I added a screenshot above in one of the threads. Does it make sense?

petter
Partner - Champion III
Partner - Champion III

You could always wrap your measures in a:

If( IsNull( <expression> ) , 0 , <expression> )

Anil_Babu_Samineni

Try to post Excel file we can sort it out. Better if you would provide QVF file

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ahaahaaha
Partner - Master
Partner - Master

Hi Vijayanth,

As an variant, replace NULL to 0 must specify the data before downloading how to process the values NULL.

Here is an example of code

Table1:

Load

RecNo()+1967 as Year,

Rand()*100 as Total,

If(RecNo()/2 = Div(RecNo()/2, 1), Rand()*10) as GtA

AutoGenerate 15;

NullAsValue GtA1;

Set NullValue = 0;

Table2:

Load

Year as Year1,

Total as Total1,

GtA as GtA1

Resident Table1;

Result in the attached file.

If you continue to replace NULL it is not necessary for the code of the script, use the operator NullAsNull.

Regards,

Andrey

cotiso_hanganu
Partner - Creator III
Partner - Creator III

What about
alt(expression,0) !?

rvijayanth
Creator
Creator
Author

Is this approach putting zeroes in the data while loading?

Anil_Babu_Samineni

It's make sense only. But, We need to look. Do you think Community can copy data from image in Qlikview. That's not preferable atleast you should create Dummy data in excel if really you want help?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful