Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
dana
Creator III
Creator III

Set Analysis Ignoring selections with default

SA_2.pngSA_3.pngHi,

I have an expression with a default Open orders period, and ignoring Invoice dates selections.

sum({<InvoiceYear=, InvoiceQuarter=, InvoiceMonth=, InvoiceWeek=, InvoiceDate=,OpenYear=, OpenQuarter=, OpenMonth=, OpenWeek=, OpenDate=, OpenDateKey={">=$(=Num(YearStart(Max(OpenDateKey)))) <=$(=Max(OpenDateKey))"}>}Amount)


The issue is: selection of Invoice year is not ignored when Open period  is selected by a user.
Can someone please explain why?

Thanks!

Labels (2)
2 Solutions

Accepted Solutions
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Max({<InvoiceIssueYear=>}OpenDateKey)

this will ignore the InvoiceIssueYear selection. 

The expression you did earlier is max(openDateKey).

So it will still evaluate without ignoring the  InvoiceIssueYear selection.

 

 

View solution in original post

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

sum({<InvoiceIssueYear=, OpenYear=, OpenDateKey={">=$(=Num(YearStart(Max({<InvoiceIssueYear=>}OpenDateKey)))) <=$(=Max({<InvoiceIssueYear=>}OpenDateKey))"}>} Amount)

This expression consists of 3 component to be evaluated:

  1. sum(Amount)<<<This part you did well in ignoring those fields by InvoiceIssueYear=, OpenYear=.
  2. OpenDateKey={">=$(=Num(YearStart(Max(OpenDateKey)))) <<<this part u did not insert the field to be ignored
  3.  <=$(=Max(OpenDateKey)) <<< same as this

For the expression to work well, you have to add in "InvoiceIssueYear=" to the max(OpenDateKey), so that:

- when InvoiceYear is selected, it will ignore this selection and return the max(OpenDateKey)[eg:1/Oct/2019] to the base expression of:

  • sum({<InvoiceIssueYear=, OpenYear=, OpenDateKey={">=[1/Jan/2019]<=[1/Oct/2019]"}Amount) 

View solution in original post

7 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Can you provide a sample app that shows what is the current result shown in the expression vs the expected result that should be displayed?

dana
Creator III
Creator III
Author

Hi Arthur,

I Attached a sample model and screen captures.

I also updated the issue:  selection of Invoice year is not ignored when Open period  is selected by a user.

Thanks!

 

 

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Try this:

sum({<InvoiceIssueYear=, OpenYear=, OpenDateKey={">=$(=Num(YearStart(Max({<InvoiceIssueYear=>}OpenDateKey)))) <=$(=Max({<InvoiceIssueYear=>}OpenDateKey))"}>} Amount)

dana
Creator III
Creator III
Author

Indeed, that works!

Frankly, I don't understand what you added, nor why it doesn't work without it..

What are the cases when dates selections are not ignored?

 

Thanks!

 

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Max({<InvoiceIssueYear=>}OpenDateKey)

this will ignore the InvoiceIssueYear selection. 

The expression you did earlier is max(openDateKey).

So it will still evaluate without ignoring the  InvoiceIssueYear selection.

 

 

dana
Creator III
Creator III
Author

Hi Arthur,

Would you kindly clarify why  InvoiceIssueYear= doesn't have the same impact?

 

Thank you!

 

 

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

sum({<InvoiceIssueYear=, OpenYear=, OpenDateKey={">=$(=Num(YearStart(Max({<InvoiceIssueYear=>}OpenDateKey)))) <=$(=Max({<InvoiceIssueYear=>}OpenDateKey))"}>} Amount)

This expression consists of 3 component to be evaluated:

  1. sum(Amount)<<<This part you did well in ignoring those fields by InvoiceIssueYear=, OpenYear=.
  2. OpenDateKey={">=$(=Num(YearStart(Max(OpenDateKey)))) <<<this part u did not insert the field to be ignored
  3.  <=$(=Max(OpenDateKey)) <<< same as this

For the expression to work well, you have to add in "InvoiceIssueYear=" to the max(OpenDateKey), so that:

- when InvoiceYear is selected, it will ignore this selection and return the max(OpenDateKey)[eg:1/Oct/2019] to the base expression of:

  • sum({<InvoiceIssueYear=, OpenYear=, OpenDateKey={">=[1/Jan/2019]<=[1/Oct/2019]"}Amount)