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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kt3
Contributor II
Contributor II

True condition is not being detected

Hi,

I'm working on Qlik Sense, where
Column 1 =Date(max_date) - if(isnull(date(issue_date)), Date(Product_Date_Created),date(issue_date)) and
Column 2 =if((Date(max_date) - if(isnull(date(issue_date)),Date(Product_Date_Created),date(issue_date)))<=183,1,0)
The condition of column 2 should give 1 if the value is less than or equal to 183 and 0 when it's not. And it can be seen clearly in column 1 that the value is 25 and less than 183, so it should give ,1 but it is giving 0. Can someone please help me understand why it is happening?
Thank you so much.

kt3_1-1750769086012.png

 

 

Labels (4)
5 Replies
FedericoDellAcqua
Contributor III
Contributor III

Are the fields on the same aggregation? 

kt3
Contributor II
Contributor II
Author

Apologies! I'm not sure what it means to be in the same aggregation. But I guess it's about whether all the data is present against each row. So, Product_Date_Created and issue_date values are at the same level, but max_date is a single value extracted from max(date_of_sale) at the script level.

FedericoDellAcqua
Contributor III
Contributor III

Don't worry! I think that this could be a problem for your result, you should either try to recreate the measure using the AGGR function to make it calculate on single rows or replicate the logic inside the script editor. 

kt3
Contributor II
Contributor II
Author

Hi,
I tried this expression at the script level, but I only get the right values when I set it as a dimension, not when it's a measure. I need this value as a measure. Is it possible?

rubenmarin1

Hi, it would be helpful if you can upload a qvf with some sample data that demonstrates the issue, so we can check what is really doing with the data behind the table.