Discussion board where members can get started with Qlik Sense.
I am not sure how to state "not equal to current month" under script
NinthStats2: //Table name
ninth_LastRead_MY //format is 'MMM-YYYY', e.g. Jan 2015, Feb 2015...
if(month(ninth_LastRead_MY)<>month(today()),'Inactive','Active') as ninth_activity
Drop Table NinthStats1;
The error I got:
As I want to create a column (ninth_activity) that is either Inactive or active.
So if month(ninth_LastRead_MY) is not equal to month(today()) which is Nov, it will be inactive, otherwise active.
Update: I miss out a (,) before 'if', problem solved
Since you said that your date format is MMM-YYYY, then you can try this:
if(Date(Date#(ninth_LastRead_MY, 'MMM YYYY'), 'MMM')<>month(today()),'Inactive','Active') as ninth_activity
What you are doing is that you are telling Qlik that your date field is formatted in 'MMM YYYY' with Date#() and then getting the month portion of it with Date() function.
Hope this helps.
Thank you! I noticed that the reason it don't work is because I miss out a (,) before 'if' in the previous sentence. Nevertheless, I learn something new from your post. Thank you