Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there any procedure to divide a month into 3 slabs i.e Slab1 (1st to 10th), 2nd (11th to 20th) and 3rd (21st to last day of the month)?
You could create a new field in your script:
If( Day(Yourdate_Field) <= 10, 'Slab1', If( Day(Yourdate_Field) <= 20, 'Slab2', 'Slab3'))
Or you could also use the above as a calculated Dimesion.
Jay
You could create a new field in your script:
If( Day(Yourdate_Field) <= 10, 'Slab1', If( Day(Yourdate_Field) <= 20, 'Slab2', 'Slab3'))
Or you could also use the above as a calculated Dimesion.
Jay
Thanks Jay,
Its working fine in a dimension... how can I upload it in the script itself?
Regards,
Rahul
Same way you can use it in the script.
If( Day(Yourdate_Field) <= 10, 'Slab1', If( Day(Yourdate_Field) <= 20, 'Slab2', 'Slab3'))
If you are taking data from sql then you can use it in query as
case when Day(Yourdate_Field)<=10 then 'Slab1' else
case when Day(...)<=20 then 'Slab2' else 'Slab3' end
end
Hi Swapnil,
I'm loading the data from a text file. Where in the script i have write it?
Regards,
Rahul
Rahul,
You can place a load Statement above the load from the text file as follows:
YourTable:
LOAD
*,
If( Day(Yourdate_Field) <= 10, 'Slab1', If( Day(Yourdate_Field) <= 20, 'Slab2', 'Slab3'))
;
LOAD
Field1,
Field2,
Yourdate_Field,
Etc
FROM SomeFile.txt (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Jay