Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to supress the null values

Hi,

I am facing one issue in vb script,

I need to export the pivot table data into excel i can export the data into excel by using vb script but, while exporting i need to supress the null values for example:

Qlikview Table:

 

Snoname
1aa
2bb
3-
4dd
5ee
6ff
7-
8hh

After exporting this table by using vb script i need to supress the null values

My expected output:

 

Snoname
1aa
2bb
4dd
5ee
6ff
8hh

Regards,

Yuvaraj

9 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Suppress it in your chart it self. Go to Presentation tab and check  "Suppress Zero Value" and "Suppress Missing".

For coding try below example.

set chart = ActiveDocument.Activesheet.CreatePivotTable

chart.AddDimension "ProductType"

chart.AddExpression "sum(Amount)"

chart.AddExpression "count(Customer)"

set cp = chart.GetProperties

cp.SuppressZero = true

chart.SetProperties cp

Regards,

Kaushik Solanki

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

Thanks for your reply i tried what mention in code but getting error as "Unterminated string Constant".

My code:

MyDoc contains qvw path

set chart = MyDoc.GetSheetObject(CH41);

chart.AddExpression "My Expression"

set cp = chart.GetProperties

cp.SuppressZero = true

chart.SetProperties cp

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try adding a dimension to the chart.

Regards,

Kaushik Solanki

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

Showing error as "Object doesn't support this method"

'AddDimension'

what are dimensions i have used in expression that dimensions only used in AddDimension function.

vinieme12
Champion III
Champion III

Have you checked Suppress when value is null in the chart that you are exporting?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

I have pivot table the data contains suppress values like below,

Snoname
1aa
2bb
3-
4dd
5ee
6ff
7-
8hh

In qlikview presentation tab if we check  "Suppress Zero Values we can achieve that but i need to perform only in script level.

vinieme12
Champion III
Champion III

Do you mean load script?

then just add a where clause when loading the data

load *

FROM XXXX

where len(trim(name))>0;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

No i need to perform in vb script level, we can't do any actions in qvw document.

In qlikview itself we can do this but i need to perform in vb script.

qv_testing
Specialist II
Specialist II

Hi,

I'm not aware about much VB Script, but my suggestion.

create 2 charts, one chart leave everything NULL aslo  (suppose object ID CH1)

and another one create with "supress when value is Null" , hide this chart in visual side, export from here

(suppose object ID CH2)


In Your VB script use second chart (CH2) 


Thanks !