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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Purushothaman
Partner - Creator III
Partner - Creator III

How to Filter MON-YY

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

 

1 Solution

Accepted Solutions
vchuprina
Specialist
Specialist

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:

vchuprina_1-1651735082716.png

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").

View solution in original post

5 Replies
Chanty4u
MVP
MVP

try this in script

where MON-YY >'Mar-18';

Purushothaman
Partner - Creator III
Partner - Creator III
Author

No, Its not working. Do I need use Year or Month Function ? 

vchuprina
Specialist
Specialist

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:

vchuprina_1-1651735082716.png

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
Purushothaman
Partner - Creator III
Partner - Creator III
Author

Hi @vchuprina ,

You are super fast. Thank  you for your great help!!! Much Appreciated! 

 

vchuprina
Specialist
Specialist

Welcome!

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").