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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set expression issue when using modifiers

This is my first app on QV and have been trying to learn QV as I develop.

I have been trying to use the master calendar (http://community.qlik.com/docs/DOC-6593) by @Richard.Pearce60 in my app and the expressions for MTD/ MTD prev. period don't seem to work.

I have loaded the master calendar from a qvd and the fact table from a qvd

I am not sure where am going wrong and would appreciate any pointers

=sum({<Date={'$(=max(Date))'},%Flag_ThisMonthToDate={1} >} Measure_Name) is what I am using for MTD numbers

Would appreciate any pointers

Thanks,

24 Replies
Not applicable
Author

Hello Richard,

This I want to show on my Dashboard Page. There are no selections and what I am focussing here is only on the current year.

I have set up an alternate state for this sheet so that the other selections don't affect this sheet.

What am I trying to do - Get the month's MTD - get the last month's MTD for a comparative period and plot the variance as a Graph.

My Set Analysis expression reads

// This year current mtd - this year last month to date comparative period
=(sum({1<Fact_Year={$(=year(Today()))},%Flag_ThisMonthToDate={1},%Flag_ThisYear={1}>}[my Measure]))
- (
sum({1<Fact_Year={$(=year(Today()))} ,%Flag_PreviousMonthComparative_M01={1}  >}[my Measure]))

My dimension in the table is Month Year.

My problem is - as I am saying Fact_Year = Year(Today())  - In the case of Jan 2014 - it doesn't take dec 2013 as the last period's MTD and shows the MTD figure for Jan 2014 as variance.

What would be your advise on this ?

Also, I didn't see the problem as you mentioned in your previous post with this set expression - it seems to be bringing back the right figures.

Thanks,

Lav

Not applicable
Author

I changed this to

// This year current mtd - this year last month to date comparative period
=(sum({1<Year={$(=year(Today()))},%Flag_ThisMonthToDate={1},%Flag_ThisYear={1}>}[my Measure]))
- (
sum({1<Year={$(=year(Today()))} ,%Flag_PreviousMonthComparative_M01={1}  >}[my Measure]))

where year is from master calendar and it worked

richard_pearce6
Partner - Specialist
Partner - Specialist

That's great Iav

Richard

Not applicable
Author

Hello Richard,

I have a question regarding the calendar - Comparative Periods. Particularly %Flag_PreviousMonthComparative_M01

When I choose Jan 2014 - the comparative period is Dec 1 - Dec 31 2013 , and when the chosen month is Feb 2014 the comparative period is Jan 1 - Jan 28th 2014. But when I choose March 2014, the comparative period should be adjusted for 28 days right ? But I don't see that happening.

Can you please throw some light on this ?

Thanks,

Lav


richard_pearce6
Partner - Specialist
Partner - Specialist


Hi Iav,

Interesting question. I can't get onto the QlikView QVW to check.

From memory: The returned dates are between the start and end date of the month, in this example that would be 1st and 28th of Feb. It also has to be equal to or less than the max date selected - 1 month. Which in your example should also be the 28th of Feb as the max date is March 31st.

Are you returning KeyDates between 1st and 28th?

Richard