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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement, show values without selecting dimensions

Hi all,

I have a report in which it gives values corresponding to the time of day and month. Month isn't important, it's the time. I'm attempting to show the sum of values of say 9am to 5pm however the value only appears when I select those times. I want to show the sum of values without selecting.

The code that shows the answer when you select the first half-hour of the day is =If(HHReadTime='00:00-00:30',sum(kwh))

so basically I want to get the sum of ReadTime>='09:00-09:30' and ReadTime<='16:30-17:00' but without having to make the actual selections.

Could you guys maybe point me in the right direction?

Thanks in advance,
McKay

1 Reply
Not applicable
Author

Hi McKay,

I suppose you should do several things: change sum and if, then take care of the correct and fitting format for your comparing HHReadTime: so with this in mind your expression should look like

sum( if(HHReadTime >= '09:30' and HHReadTime <= '16:30', kwh, 0) )

As I said the format of two literals you are comparing the fieldvalue with has to fit to the format of the field.

Regards, Roland