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: 
Anonymous
Not applicable

filter zero values and adjust code

Good morning,

I ask for your help to solve two problems I can't solve.

1) The first is the "filter zero values". I would like to filter every row that has [money cashed by single game] = 0.

I have been looking to many posts and tried but could not find a solution

2) On a previous posts I got solutions from "swuehl" and "SunnyT." and I would like to see if Stefen's code can be adjusted to show the total number of games that are in one platform, like in Sunny's solution, or in my case I cannot use that code.

I show here below two pictures for the above two questions and I enclose the sample files.

1)

how can I filter zero values.jpg

2)

total by Stefan needs to be modified.jpg

Thank you for your help

Antonio

1 Solution

Accepted Solutions
sunny_talwar

Try the attached

//based on a solution by Stefan Wuhl on March 31, 2016 from Qlikview forum

// ATTENTION: total on the top is not correct

=If([total cashed] > 0, Count({<[serial number]>}Total<Town,Centre,[platform name],[game name]> [serial number])*Avg(1))

//based on a solution by Stefan Wuhl on March 31, 2016 from Qlikview forum

// ATTENTION: total on the top is not correct

=If([total cashed by platform] > 0, Count({<[serial number]>}Total<Town,Centre,[platform name],[game name]> [serial number])*Avg(1))

1)

Capture.PNG

2)

Capture.PNG

View solution in original post

4 Replies
sunny_talwar

Try the attached

//based on a solution by Stefan Wuhl on March 31, 2016 from Qlikview forum

// ATTENTION: total on the top is not correct

=If([total cashed] > 0, Count({<[serial number]>}Total<Town,Centre,[platform name],[game name]> [serial number])*Avg(1))

//based on a solution by Stefan Wuhl on March 31, 2016 from Qlikview forum

// ATTENTION: total on the top is not correct

=If([total cashed by platform] > 0, Count({<[serial number]>}Total<Town,Centre,[platform name],[game name]> [serial number])*Avg(1))

1)

Capture.PNG

2)

Capture.PNG

Anonymous
Not applicable
Author

Thank you Sunny !!! Works perfectely...

So, the If...on the expression "total cashed by the platform" at the beginning acts as a filter...!!!

Furthermore you modified the other one changing from ...*Sum(1)/* to ...*Avg(1)/*.

I am not familiar with these so please can you briefly comment what ...*Avg(1))/* does at the end of:

=If([total cashed by platform] > 0, Count({<[serial number]>}Total<Town,Centre,[platform name],[game name]> [serial number])*Avg(1))/*

Best regards

Antonio

sunny_talwar

So Stefan's intention was that to change my if statement at the beginning of my initial solution

If(Count([serial number]) > 0,

to be driven by a simple expression

Sum(1)

But for some unknown reason to me, Sum(1) was showing a value greater than 1 for each of your dimension and Stefan's goal was to make it multiply by just 1. So I changed Sum(1) to Avg(1)

The other If Statement is to do exactly what you meant. Based on the first expression being greater than 0, remove other expressions if they don't meet the criteria.

HTH

Best,

Sunny

Anonymous
Not applicable
Author

Thank you Sunny,

Best regards

Antonio