Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time Compare Problem (SQL)

Hi Everyone,

I'm getting crazy because - I guess - a small problem:

I import Data from a SQL-Database with OLE-DB - there is a data field (Date) with the format DD.MM.YYYY hh:mm.

My settings look like that:

SET TimeFormat='hh:mm';

SET DateFormat='DD.MM.YYYY';

SET TimestampFormat='DD.MM.YYYY hh:mm';


In another field a got some Entries per Month (SU_TIME) over 3 years.

Now I just want to show the average per month with AVG() and select one year as following:

AVG ({$<Date={2015}>}SU_TIME)

Dimenson is just Date.

The diagramm won't show any data to me.

Even simple if-statements do not work with Date ...


Hopefully you can help me!

Thanks a lot,

Jan

13 Replies
Not applicable
Author

but if(Date>now(),..,..) should work - right?

Anil_Babu_Samineni

No, It won't if Date has simple format and Now() returns Full timestamp. How come this works

You need to manipulate or play with Date format

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Using separate year fields is absolutely common practice.

Nothing is faster than selecting a field directly (without wildcards) via set analysis.

So this "waste of space" you're thinking about is negligible, because QlikView stores only distinct values with the help of bit stuffed pointers...

Not applicable
Author

All of your suggestions helped me a lot!

I firgured out as follows (in Script):

Year(Date) as Year,

Month(Date) as Month,