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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Simon4
Creator
Creator

Neglecting null values in a KPI

Hi all,

I have made a KPI that calculates the price difference of a item between the earliest date and latest date selected. Unfortunatly some items have null values at times (because of administrational error). I want to neglect these null values and make it use the first value it sees.

I tried :

FirstSortedValue(({<Netpurchaseprice={"<0>0"}>} Netpurchaseprice/Quantity),- Datecreated)/FirstSortedValue(({<Netpurchaseprice={"<0>0"}>} Netpurchaseprice/Quantity),Datecreated)-1

But it does not work.

 

This is what I am trying to accomplish:

 

Datecreated Netpurchaseprice
11-9-2021 € 0,00
17-12-2021 € 17,49
1-2-2022 € 17,49
4-7-2022 € 21,83
23-8-2022 € 21,83
17-9-2022 € 22,17
   
   
KPI must show 27%

 

Thank you kindly in advance,

 

Simon

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Hi, if you remove the extra parenthesys it should work:

FirstSortedValue({<Netpurchaseprice={"<0>0"}>} Netpurchaseprice/Quantity,- Datecreated)/FirstSortedValue({<Netpurchaseprice={"<0>0"}>} Netpurchaseprice/Quantity,Datecreated)-1

View solution in original post

2 Replies
rubenmarin

Hi, if you remove the extra parenthesys it should work:

FirstSortedValue({<Netpurchaseprice={"<0>0"}>} Netpurchaseprice/Quantity,- Datecreated)/FirstSortedValue({<Netpurchaseprice={"<0>0"}>} Netpurchaseprice/Quantity,Datecreated)-1

Simon4
Creator
Creator
Author

It works, thankyou!