Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Field Date doesn't give me the Year

Dear All,

I am reading a date from an excel file using ApplyMap in one particular cell (where date is located) and assigning the same to a variable.

The problem is that when I apply "Year" and "Month" function doesn't extract those values eventhough date is extracted correctly and really don't know why.

The sentence I am using is following,

Text(ApplyMap('MAP_DATEV_CSAV',@DATE,'?')) AS TariffDate,

Month(ApplyMap('MAP_DATEV_CSAV',@DATE,'?')) AS Month_To,

Year(ApplyMap('MAP_DATEV_CSAV',@DATE,'?')) AS Year_To,

Therefore, "TariffDate" appears OK in the module, however "Month_To" & "Year_To" don't.

Any ideas. Many thanks in advance.

Mauriccio

4 Replies
rbecher
MVP
MVP

Why you're using ApplyMap?

Astrato.io Head of R&D
mike_garcia
Luminary Alumni
Luminary Alumni

Hi,

Load the Excel file where the date value is being extracted from and create a list box for that field. If the value is aligned to the left, it is being interpreted as text, instead of a number which are aligned to the Right.

If the value is being interpreted as text, use the function:

Month(Date#(ApplyMap('MAP_DATEV_CSAV', @Date, '?'), 'DD/MM/YYYY')) as Month_To


Important >> Change 'DD/MM/YYYY' in the above expression to whatever format the text date is actually displayed on.

Hope this helps.

Mike.

Miguel García
Qlik Expert, Author and Trainer
Not applicable
Author

Dear Mike,

Good day and many thanks for your help/tip.

I have tried mentioned, however it didn't work. I have done a test to show the field applying mentioned tip, nevertheless the result is NULL.

Any thoughts??

Mauriccio

Not applicable
Author

Dear Ralf,

God day to you.

I am using ApplyMap because the original file is an excel where I need to extract crossing colums & rows.

Many thanks.

Mauriccio