Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_chan
Specialist
Specialist

How to ignore selection in a MTD set analysis?

Hi guys,

i want to ignore Day field in my mtd analysis. but it didnt seem to be working.  my expression as such:

count({<Day=,Year=, Month=, Week=,Date= {">=$(=MonthStart(Date(Max(Date))))<=$(=Max(Date))"}>} record_id)

What is missing??

1 Solution

Accepted Solutions
sunny_talwar

Just the day field is not working? May be you need to ignore it in your set modifier for Date?

Count({<Day=,Year=, Month=, Week=,Date= {">=$(=MonthStart(Date(Max({<Day>}Date))))<=$(=Max({<Day>}Date))"}>} record_id)

View solution in original post

10 Replies
dsharmaqv
Creator III
Creator III

Try this

count({<Date= {">=$(=MonthStart(Date(Max(Date))))<=$(=Max(Date))"},<Day=>} record_id)

sunny_talwar

Just the day field is not working? May be you need to ignore it in your set modifier for Date?

Count({<Day=,Year=, Month=, Week=,Date= {">=$(=MonthStart(Date(Max({<Day>}Date))))<=$(=Max({<Day>}Date))"}>} record_id)

enriquem
Creator
Creator

Hi,

I don't know how it's build your data model, but in your expression you are calculating the dates that are more bigger or equal than the max date, so you will get just the max date and then you get the less dates than the mas(date), so why you don't try to simplify this in :

count({<Date= {"<=$(=MonthStart(Max(Date)))"}>} record_id)

In other hand, I supose that your calendar dimension have a 'week' field, do you try to do the set analysis by this field??

count({<Month= {"WHATEVER YOU WANTED"}>} record_id)


Regards.

Kind Regards,
Enrique Mora.
jim_chan
Specialist
Specialist
Author

Hey bro! happy new year! urs is right.!

can you tell me your magic bro??  why need to put {< Day >} in

Date= {">=$(=MonthStart(Date(Max({<Day>}Date))))<=$(=Max({<Day>}Date))"}>},



Rgds

Jim

sunny_talwar

I have no idea, but since putting ignoring day outside was not giving you what you wanted, I thought you may want to ignore it within your set modifier for Date. Because that was the only place left where you can add it

jim_chan
Specialist
Specialist
Author

i see. or would  you be able to provide me standard MTD YTD set analysis?

maybe the one i have created is wrong.

sunny_talwar

Here are some examples:

YTQ, QTD, MTD and WTD

jim_chan
Specialist
Specialist
Author

i can see it is using DateNum= for MTD or YTD. y cant use Date= directly?

IF i were to create a DateNum in my MasterCalendar, is it gonna be as such?

  NUM(TempDate) AS DateNum ?

sunny_talwar

You can use Date. Everyone's requirements are slightly different and that link is just providing general guidelines. I don't think we would be able to provide you a link which matches your requirement 100%. There will always be some tweaks that you will have to make to make sure your requirements are met