Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
i have a value of a field like this R191024_000008
where i want to consider only first 5 characters R1910 where 'R' stands for Request, 19 is Year(2019) and 10 is Month(Oct.). can any one help me to get them in qlik script..
Regards
Hi
Try this
Sectio:
Load * Inline [
Dat
R191024];
Sect2:
Load Dat,
Left(Dat,1) as request,
mid(Dat,2,2) as Year1,
Month(Date#(mid(Dat,4,2),'MM')) as Month1,
mid(Dat,6,2) as Day1
Resident Sectio;
Hope it helps
Thanks
An easier one might be like:
Year(Date#(left('R191024_000008',5), 'RYYMM')) as Year,
Month(Date#(left('R191024_000008',5), 'RYYMM')) as Month
Hi
Try this
Sectio:
Load * Inline [
Dat
R191024];
Sect2:
Load Dat,
Left(Dat,1) as request,
mid(Dat,2,2) as Year1,
Month(Date#(mid(Dat,4,2),'MM')) as Month1,
mid(Dat,6,2) as Day1
Resident Sectio;
Hope it helps
Thanks
An easier one might be like:
Year(Date#(left('R191024_000008',5), 'RYYMM')) as Year,
Month(Date#(left('R191024_000008',5), 'RYYMM')) as Month