Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I use QV for the last 4 months,so I'm still pretty new here.
Here's my problem :
I have a var $(HEURE_NOW) which equals to reloadtime().
another Var $(CURRENT_TIME) is calculated with $(HEURE_NOW) to express this :
=If(isnull(left(minute($(HEURE_NOW)),1)),
if(right(minute($(HEURE_NOW)),1)<5,
maketime(hour($(HEURE_NOW)),'00')
,
maketime(hour($(HEURE_NOW)),'05')
)
,
If(right(minute($(HEURE_NOW)),1)<5,
maketime(hour($(HEURE_NOW)),left(minute($(HEURE_NOW)),1)&0)
,
maketime(hour($(HEURE_NOW)),left(minute($(HEURE_NOW)),1)&5)
)
)
Efficient ,simple and reliable .
So in Exemple : if the var$(HEURE_NOW) = 9h54 , $(CURRENT_TIME) = 9h50,or, if var$(HEURE_NOW) = 10h07, $(CURRENT_TIME) = 10h05
I know it works ,because $(CURRENT_TIME) is shownable in a text field.But not in the big table which display different hours ....
Despite that,if I put 9h50 directly in the expression of the var $(CURRENT_TIME), this fully works.(You 'll see a black thing in the matching hour)
I really don't understand where the problem is .[:'(]
So I ask for your help,
thanks
I can't unpack RAR files, and there's not much point to compressing a QlikView application since it is already compressed.
All you're doing is flooring the reload time to the nearest 5 minutes, right? How about this? Does this solve the problem?
time(frac(floor(reloadtime()*288)/288))
Hi,
Sorry for sending rar files ,thought it would be better.
It works pretty fine(Thanks !!) and to answer your question,I need to floor to the nearest 5 minutes just before the reloadtime().(ie-> 9h27 ,my var : 9h25);
How come, when reloadtime() = 9h03, left(minute(reloadtime()),1) shows nothing not even null()?
Had a look at your code and saw that you make heavy use of the maketime function.
I also saw that you already use the 1/288 fraction to represent the 5 mins intervals.
So by multiplying your date/time values by 288, eliminating the fraction and divide by 288 you get the 5 mins intervals you are trying to build "by hand" from the hour and minute values.
You might be able to clear out quite some code using this approach. Your data loading will also speed up, Could not really follow your Calendar build, this could be simplified I assume.
Also with the current 10 SALLE and the 5 mins intervals you should end up with 2880 records - your table however has 20749 rows?
First time a see a "gantt" type diagram in QlikView, very nice! The use of a small inline table in combination with lookup could replace your lengthy if?
Hey,
Thanks for helping me,
I'll look in the SALLE 10 what happened.it's a bit weird.
About lookup(),It'd be a good idea but in every 5 mins intervals you may have different colours according to conditions (if the appointment was scheduled,if the appointment is over etc.......).Lookup() should work great if there was One and only one condition.
That's why I' dont think lookup() alone could be sufficient ,and I didn't find another way than if(s)
Sorry for my english,it's been a long time that I didn't practice....
yamaz wrote:How come, when reloadtime() = 9h03, left(minute(reloadtime()),1) shows nothing not even null()?
Works for me, at least for a reloadtime of 9h06. When you're having trouble, break the expression into pieces to see where the problem is occurring. On my computer, for a sample application, I get this:
reloadtime() = 5/7/2010 9:06:37 AM
minute(reloadtime()) = 6
left(minute(reloadtime()),1) = 6