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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Specialist
Specialist

Creating date from year

Hi Team,

 

I am new to Qlik

I have the below data set :-

FY20CountryWBS Element DescriptionPAR/WBS ElementYearAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberJanuuaryFebuaryMarch
CapitalBRRenaulat Wheels907190-12020102030303030303030303030
CapitalBRSpare Gear907190-22020100200300400500600700800900100011001200
CapitalCZReplace Old Seat Covers907190-3202050055060065070075080085090095010001050

 

I have done the below in qlik script:-

CrossTable(Month, Amount, 6)
LOAD FY20,
Country,
'Actual' as Flag,
[WBS Element Description],
[PAR/WBS Element],
Year,
April,
May,
June,
July,
August,
September,
October,
November,
December,
Januuary,
Febuary,
March,
F18
FROM
[C:\Users\Vaishali\Documents\Work Varrooc\To be deleted Varroc.xlsx]
(ooxml, embedded labels, table is Data);

NoConcatenate

Temp:
Load *
,

Date(Floor(Year),'DD/MM/YYYY') as Date
Resident Data;
Drop table Data;

 

However, i am not able to able to created "Date" using Year field form the data.

I have tried :-

Date(Alt(Year, 'DD/MM/YYYY') as new date --> Didn't worked- getting output as ex:- 12/07/1905

Date(Date#(Year, 'YYYY'), 'DD/MM/YYYY') as New_Date-> Output : 01/01/2020 for all the months

 

Can any please help ?

 

 

 

3 Replies
tresesco
MVP
MVP

Try like:

 

Date(MakeDate(Year, Date#(Month, 'MMMM')), 'DD/MM/YYYY') as Date

Aspiring_Developer
Specialist
Specialist
Author

It did not worked.

It seems my moth is in text .

Not sure !

Any other solution

Brett_Bleess
Former Employee
Former Employee

Here is a Design Blog post to go along with what the poster was discussing:

https://community.qlik.com/t5/Qlik-Design-Blog/The-Date-Function/ba-p/1463157

https://community.qlik.com/t5/Qlik-Design-Blog/Get-the-Dates-Right/ba-p/1476178

Have a look at those and see if they provide the missing info to get you going.  The last thing would be Help content:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/DateA...

That should cover most everything hopefully.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.