Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I need filter where MON-YY is Greater than Mar-18. How to do that? Below is my Dataset
| MON-YY | Sales |
| Jan-18 | 13,609 |
| Feb-18 | 17,546 |
| Mar-18 | 2,914 |
| Apr-18 | 3,710 |
| May-18 | 3,150 |
| Jun-18 | 1,850 |
| Jul-18 | 721 |
| Aug-18 | 856 |
| Sep-18 | 1,848 |
| Oct-18 | 3,284 |
| Nov-18 | 407 |
Hi,
You should use Date# and Date functions to show that MMM-YY is a field with dates and not with text
Data:
LOAD
[MON-YY],
Sales
Where [MON-YY] > Date(Date#('Mar-18', 'MMM-YY'), 'MMM-YY')
;
LOAD
Date(Date#([MON-YY], 'MMM-YY'), 'MMM-YY') AS [MON-YY],
Sales;
LOAD * Inline[
MON-YY, Sales
Jan-18, 13609
Feb-18, 17546
Mar-18, 2914
Apr-18, 3710
May-18, 3150
Jun-18, 1850
Jul-18, 721
Aug-18, 856
Sep-18, 1848
Oct-18, 3284
Nov-18, 407
];
Result:
Regards,
Vitalii
try this in script
where MON-YY >'Mar-18';
No, Its not working. Do I need use Year or Month Function ?
Hi,
You should use Date# and Date functions to show that MMM-YY is a field with dates and not with text
Data:
LOAD
[MON-YY],
Sales
Where [MON-YY] > Date(Date#('Mar-18', 'MMM-YY'), 'MMM-YY')
;
LOAD
Date(Date#([MON-YY], 'MMM-YY'), 'MMM-YY') AS [MON-YY],
Sales;
LOAD * Inline[
MON-YY, Sales
Jan-18, 13609
Feb-18, 17546
Mar-18, 2914
Apr-18, 3710
May-18, 3150
Jun-18, 1850
Jul-18, 721
Aug-18, 856
Sep-18, 1848
Oct-18, 3284
Nov-18, 407
];
Result:
Regards,
Vitalii
Welcome!