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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Applicable88
Creator III
Creator III

How to handle Date columns which cannot be interpret as those in Qlik Analysis

Hello!

I have following example  table. Its just an cutout of a very big database:

Month.Year Sales
01.2020 100
01.2020 100
01.2020 100
01.2020 100
02.2020 200
02.2020 200
02.2020 200
02.2020 300
03.2020 400
03.2020 400
03.2020 400
03.2020 400

I already got so much help from many here, about how to set the format right. For example Date(Date#()) function and so forth. Its simply not working out for me. I get other problems when I set it manually to a date 'MM.YYYY' format or problems with loading the column at the script with a date related function. 

So I  try it to take the column now as a number: I guess for Qlik its just a general number Column. Since its not a "date column" I cannot use Date function relate to the time of today for example in my set expressions and if-functions.

I want to express the following in an KPI window: Always show me the Sales Value (no sum, just whats in the field respective to the month) of todays month. 

So as an example: In January please return 100, If today would be a day in February please return 200, and when we are in March 400 and so forth....always the actual month we no are at. 

My problem is following: how Qliksense actually interpret an format like 01.2020? when we get to 2021, will Qlik get the difference between 01.2020 and 01.2021? If  for instance it doesn't interpret 04.2021 (since its next year and also later in the timeline) bigger than 12.2020 I have a big problem using Min/Max Functions.

Can someone write me a set analysist  expression, a IF-Function or anything else which solve my problem?

Thanks a lot in advance!

1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

If you are able to get to the data load editor the best way would be to create additional fields there to create year and month fields. Either as a preceding load or creating a new table using resident load and dropping original table.

either in the script or table you could use the subfield string function to break this out.

subfield ('Month.Year', '.', 1) -  for Month

subfield ('Month.Year', '.', 2) -  for Year

View solution in original post

1 Reply
Lisa_P
Employee
Employee

If you are able to get to the data load editor the best way would be to create additional fields there to create year and month fields. Either as a preceding load or creating a new table using resident load and dropping original table.

either in the script or table you could use the subfield string function to break this out.

subfield ('Month.Year', '.', 1) -  for Month

subfield ('Month.Year', '.', 2) -  for Year