Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
DiegoF
Creator
Creator

Add filter: months name from start of year to actual month

Hello Qlik programmers!

I have a QlikSense that has 2 filters applied when you enter, one is the current Year (2022) and the other is the months that have passed til this month selected

DiegoFraj_1-1651575184715.png

 

So with this, I´m doing a nprinting and I´m trying to add these 2 filters, I do have the year filter like this and it works (it filters me with 2022):

DiegoFraj_2-1651575364688.png

 

But I don´t know how to "attack" the month one, any suggestions?

Thanks in regards!

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Sorry - I wasn't clear enough. Have you used typical advanced search syntax? Same as the one you would use in Qlik Sense Filter Pane?

So it should be: 

  • Advanced Search: =[FECHA_MES] <=Month(Today())

See below:

Lech_Miszkiewicz_0-1651717910949.png

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

6 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

This is usually very easy but we must know data type of the month field and the way that field was created in your Qlik Sense load script. The usual approach of creating such field would be the use of Month() function during load script; like": Month([some date]) as FECHA_MES

If this is how your field was created then the month field is actually of Dual type and therefore can leverage all built-in Qlik date related functions.

In NPrinting you could then use Advanced search option like

  • FECHA_MES
  • Advanced Search is: <=Month(Today())

Understanding data type of is critical in this case. I suggest you go through those topics I wrote on the subject:

All blog posts about filters:

cheers

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
DiegoF
Creator
Creator
Author

Thanks for answering!

However I tried to use your advance search but it´s not working (also i used that formula in Qlik to see what the result is and its just empty), I do use FECHA_MES as a Month.

Here is my LOAD Script:

DiegoFraj_0-1651651210042.png

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Sorry - I wasn't clear enough. Have you used typical advanced search syntax? Same as the one you would use in Qlik Sense Filter Pane?

So it should be: 

  • Advanced Search: =[FECHA_MES] <=Month(Today())

See below:

Lech_Miszkiewicz_0-1651717910949.png

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
DiegoF
Creator
Creator
Author

I have used Regex in some other occassions but not that much in Nprinting advanced search, but I would guess it works very similar (at the end of the day, they are regular expressions). Now that I see the formula, is pretty much straightforward to the point and pretty easy hahaha, I was trying to do it so complicated idk why, thanks a lot! 

Also, I have a question, the expression is easy to understand and it works me as a filter, but for curiosity, I inputed that formula into a field to see what the result is and it is -1 or 0, being -1 the Months until today. Why is the result -1 and not the names of the month visually? 

Thank you!

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, I am not sure what do you mean by: 

"I inputed that formula into a field to see what the result is and it is -1 or 0, being -1 the Months until today. Why is the result -1 and not the names of the month visually? "

Advanced search works like search in filter pane so here is mine example and it results in month names being shown. This is exactly the same as NPrinting applying advanced search filter.

Lech_Miszkiewicz_0-1651795309870.gif

 

If you have done something else then maybe provide a screenshot and description.  -1 is equivalent of "True()" and 0 is equivalent of "False()" in Qlik, so whatever you have done is probably returning result of that test.

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
DiegoF
Creator
Creator
Author

Yeah yeah, It´s just the result of my test:

DiegoFraj_1-1651820022077.png

Also, I didn´t knew you could use the filter pane as testing for your advanced search, I´m quite new to Qlik, but I think this feature is pretty nice, thanks!