Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
Hi
May be this
If([Total sale]<>null(), [Total sale]/[Sale target], null())
Hi
May be this
If([Total sale]<>null(), [Total sale]/[Sale target], null())
No it works very well now! Thanks a lot.