I wrote the code below which used to work. It should count from 7 am to 21:00 to get a goal off 7000 steps.
If time is 9 am and i walked 700 steps it should calculate 1000 - 700 and display 300.
Somehow this isnt working and i cant find out whats wrong.
Welcome @sharpa. A lot of people have posted about multiple conditional on one layer. Become a sort of competition. I am certain I am correct in saying Facer Recommend 3. They have been Tightening the Syntax restrictions recently to make the various OS systems served more compatible.
I am not in a position to help at the moment. One of the Code Masters might step in an help you with a single line Formula that does the same job. You sliding scale goal is only a direct function of the hour of the day.
@sharpa for starters it seems illogical to have >= . I would have thought that just = was correct . I still have not got my head around exactly what is supposed to happen . I think you could make yourself a test with a Complication on each separate layer it is working fine for me without the <> .
$#DHZ#>=21?(7000-#ZSC#) :$
just try
$#DHZ#=21?(7000-#ZSC#) :$
NB if you look at the beginning of the formula grid you posted . There is an extra $ at the beginning that is a NOP .
So I have made a Test with separate layers I think I have done enough to give the Idea . See you need < and > on the first and last formulas . Smaller than < will always Show everything that is lower in value than the current hour regardless of the = sign .
If you are not sure how to Inspect this draft . Let us know .
I would gladly help, but cant understand how should this counter work. Why does it have to add 500 steps each hour, but subtract 500 in the first hour. Would you not want it to keep track of progress continuously rather than in hourly jumps?
I also wonder what is it supposed to show. Each hour there is one less condition met. Before 8h there would be 13 different numbers since all but last condition will be met (7 is smaller than 20 also smaller than 19 and so on).