Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
bsocks_11415
Contributor
Contributor

Problem with if statement

I have a dataset with current and historical daily data on an hourly basis. The current days data only exists up to current time. Because of this, when comparing the hour by hour information, my chart shows current value = 0 for any time stamp > now. I tried creating a dimension to replace the imported timestamp, but the condition is not taking. Can someone tell me where I am going wrong? The idea is that each value above hour 15 should be NULL and I can use ignore null to remove them from my line chart.

My calculated dimension (far right) is: =if(hour <= Date(Now(),'hh'), hour, NULL())

 

bsocks_11415_1-1629406760452.png

 

 

Labels (2)
2 Replies
edwin
Master II
Master II

you may be comparing different data types.  i suggest using hour(now()) and compare it with hour(TIMESTAMPFIELD) or maybe you already extracted the hour into a number field, the hour function return an integer and will be same type

Maria_Halley
Support
Support

@bsocks_11415 @edwin 

I am moving this to the App development board for better visibility