Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
farheenayesha
Creator
Creator

How to display rows with zero values

Hi,

     I am trying to show utilization % of sheet in pivot table. However i am not able to show the sheets with zero values in the pivot table.

I am having 3 documents(Doc1,Doc2 & Doc3) and each has got few sheets.I am facing two issues in my dashboard. 


1. Doc1 has got 14 sheets and out of which only 11 has utilization % and the other three doesn't have any data. For these 3 sheets i want to show value as zero. However with my expression, these three rows are not getting displayed in pivot table. Please find the data of the pivot table below.

Expression:Count(distinct UNIX_ID_GOV)/count(DISTINCT total UNIX_ID_RST)    

     

SheetGOVRSTGOV/RSTDocument
Sheet1112112100.0%Doc1
Sheet2112112100.0%Doc1
Sheet311011298.2%Doc1
Sheet410911297.3%Doc1
Sheet510711295.5%Doc1
Sheet610711295.5%Doc1
Sheet710311292.0%Doc1
Sheet89811287.5%Doc1
Sheet99111281.3%Doc1
Sheet108711277.7%Doc1
Sheet116411257.1%Doc1


However, when i am checking 'Show all Values' at dimension level it is showing the other sheets of other docs as well (Doc2 & Doc3). Which I dont want. Please find the data below.

     

SheetGOVRSTGOV/RSTDocument
Sheet1112112100.0%Doc1
Sheet2112112100.0%Doc1
Sheet311011298.2%Doc1
Sheet410911297.3%Doc1
Sheet510711295.5%Doc1
Sheet610711295.5%Doc1
Sheet710311292.0%Doc1
Sheet89811287.5%Doc1
Sheet99111281.3%Doc1
Sheet108711277.7%Doc1
Sheet116411257.1%Doc1
Sheet1201120.0%Doc1
Sheet1301120.0%Doc1
Sheet1401120.0%Doc1
Sheet1501120.0%Doc2
Sheet1601120.0%Doc2
Sheet1701120.0%Doc2
Sheet1801120.0%Doc2
Sheet1901120.0%Doc2
Sheet2001120.0%Doc2
Sheet2101120.0%Doc2
Sheet3201120.0%Doc2
Sheet3301120.0%Doc3
Sheet3401120.0%Doc3
Sheet3501120.0%Doc3
Sheet4701120.0%Doc3
Sheet4801120.0%Doc3
Sheet4901120.0%Doc3
Sheet5001120.0%Doc3
Sheet5101120.0%Doc3
Sheet6401120.0%Doc3
Sheet6501120.0%Doc3

I want the Pivot as below:

     

Sheet1112112100.0%Doc1
Sheet2112112100.0%Doc1
Sheet311011298.2%Doc1
Sheet410911297.3%Doc1
Sheet510711295.5%Doc1
Sheet610711295.5%Doc1
Sheet710311292.0%Doc1
Sheet89811287.5%Doc1
Sheet99111281.3%Doc1
Sheet108711277.7%Doc1
Sheet116411257.1%Doc1
Sheet1201120.0%Doc1
Sheet1301120.0%Doc1
Sheet1401120.0%Doc1


2 . My second issue is showing the count of these sheets as 11. Currently with my expression(Count (distinct Sheet)) it is showing the count as 11. It is not counting the rows with zero values. I want the count of sheet as 14.

Kindly help me to resolve these 2 issues.

stalwar1‌@

1 Solution

Accepted Solutions
sunny_talwar

This

=Count(DISTINCT {<Tab_DocName = p(Tab_DocName), DocName>} Sheet)

View solution in original post

11 Replies
sunny_talwar

May be use a calculated dimension

If(Document = 'Doc1', Sheet)

and then keep 'Suppress Zero Values' unchecked, but check 'Suppress When Value Is Null' on the dimension's tab

farheenayesha
Creator
Creator
Author

Thanks for the quick reply Sunny.

I dont want to hard code the document values. Let me know if there is any dynamic way to achieve it.

And i want these two solutions in Qliksense. Any idea on how to implement this in Qliksense?

sunny_talwar

What do you mean when you say Dynamic? Dynamic based on what?

farheenayesha
Creator
Creator
Author

Dynamic based on selecting Document.

sunny_talwar

Would you be able to share a sample to show what is going on? I am not sure I understand how you have this all setup

farheenayesha
Creator
Creator
Author

Hi Sunny,

    Pls find the sample application attached. In the qvw i have two docname fields, one is Docname and another is Tab_Docname.

When i select Tab_Docname then i get the correct count of sheet and rows with the zero values in the pivot table.

Capture.JPG

However, when i make selection in the Docname i get count as 11 and rows with zero values will not show up.

Capture1.JPG

I want to have Docname as filter in my dashboard and to show the count as 14 along with zero value rows. Sample is in Qlikview but i want the solution in Qliksense. Please find the sample attached

qlikview979
Specialist
Specialist

sunny_talwar

Try with this expression

=Count(distinct Users) + Sum({1<Tab_DocName = p(Tab_DocName)>}0)


Capture.PNG

farheenayesha
Creator
Creator
Author

You are genius Sunny

It would be great if you could help me to achieve the count as well. Currently i am getting 11. but i need the count as 14.