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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
CavellMok
Contributor II
Contributor II

Set analysis - comparing 2 numeric columns

Hi,

I want to do a set analysis by comparing 2 numeric columns but don't know how to write the syntax. 

This is an example of my data:

clipboard_image_0.png

I want to build a waterfall chart as below:

1st bar: sum FCST where Actual=0 but FCST>0 in last week for all stores (should be 1 in this example)

2nd bar: sum (FCST-Actual) where Actual>0 but FCST>Actual in last week for all stores (should be 2-1=1 in this example)

Can anyone help please? Thank you very much!

Labels (2)
4 Replies
Anil_Babu_Samineni

Perhaps this?

1) Sum({<Actual={"=Sum({<Week={$(=Max(Week-1))}>} FCST)=0"}>} FCST)

2) Sum({<Actual={"=Sum({<FCST={"=Sum({<Week={$(=Max(Week-1))}>}FCST)>Sum({<Week={$(=Max(Week-1))}>}Actual)"}>} Actual)>0"}>} (FCST-Actual))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
CavellMok
Contributor II
Contributor II
Author

Thank you for your help! However, both are not working. The first one returns to 0 and the second one has error 😞

Anil_Babu_Samineni

Please share sample data in excel instead image, I will share QVF file for you

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
CavellMok
Contributor II
Contributor II
Author

Attached is the sample data. Thank you!