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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mini_Elaine
Contributor III
Contributor III

To calculate measure without null

Hi community,

I am new to Qliksense and struggling to calculate measure based on another measure with conditions. I have two data table like below and I need to calculate total sale for each product and percentage of their current sale to target (Total sale/sale target):

Table1 sale target

ID Sale target
A 3
B 6
C 4

 

Table 2 sale record

ID Date of sale
A 01/04/2022
A 01/03/2023
A 31/05/2020
B 01/03/2023
B 01/07/2019

 

I associate two tables with ID and then calculated a measure as total sale for each product based with syntax as count([ID]). Apparently product C didn't have any sale thus show as '-'. Then I only like to calculate these products with sale available. 

The syntax I used is: 

If([Total sale]<>null, [Total sale]/[Sale target], null)

It shows as error. Any thought?

 

Many thanks,

 

 

 

Labels (1)
1 Solution

Accepted Solutions
brunobertels
Master
Master

Hi 

May be this 

If([Total sale]<>null(), [Total sale]/[Sale target], null())

View solution in original post

2 Replies
brunobertels
Master
Master

Hi 

May be this 

If([Total sale]<>null(), [Total sale]/[Sale target], null())

Mini_Elaine
Contributor III
Contributor III
Author

No it works very well now! Thanks a lot.