Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
asmithids
Partner - Creator II
Partner - Creator II

Substituting a Field Value in a Set Analysis Expression

Hello,

I have a situation where I need to compute cancelled quantity based off a different calendar from the Master Calendar. Invoice reporting is based on the following Master Calendar:

Master Calendar:

  • InvYear
  • InvMonth
  • InvoiceDate

Cancelled orders reporting is based on the following orders calendar:

Orders Calendar:

  • SOYear
  • SOMonth
  • OrderDate

I am trying to use the following set expression to sum cancelled quantity per month based in the Orders Calendar. 

=Sum({$<SOMonth={‘Jan’}, SOYear={"Selected Invoice Year"}>} CancelledQty)

Question, is there a set modifier function that allows the use of  "Master Calendar” where, as I select a year from the Master Calendar, the value of the year (i.e. 2015) is used as the parameter for the SOYear={"Selected Invoice Year"} set modifier? 

Thank you in advance for any assistance with this question. 

1 Solution

Accepted Solutions
Not applicable

Smith, Please create a variable Let vInYear = Max(InYear) & use the variable in set analysis

Sum({$<SOMonth={‘Jan’}, SOYear={"$(vInYear)"}>} CancelledQty)


If you not interested adding the variable try like below.


Sum({$<SOMonth={‘Jan’}, SOYear={"$(=Max(InYear))"}>} CancelledQty)

View solution in original post

5 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

try using a canonical date

Canonical Date

Not applicable

Smith, Please create a variable Let vInYear = Max(InYear) & use the variable in set analysis

Sum({$<SOMonth={‘Jan’}, SOYear={"$(vInYear)"}>} CancelledQty)


If you not interested adding the variable try like below.


Sum({$<SOMonth={‘Jan’}, SOYear={"$(=Max(InYear))"}>} CancelledQty)

maxgro
MVP
MVP

=sum({$<SOMonth={‘Jan’}, SOYear={"$(=max(InvYear))"}>} CancelledQty)

=sum({$<SOMonth={‘Jan’}, SOYear={"$(=only(InvYear))"}>} CancelledQty)

asmithids
Partner - Creator II
Partner - Creator II
Author

Works Great!!  Thank you dathu.qv

asmithids
Partner - Creator II
Partner - Creator II
Author

Thank you Massimo.  This option works perfectly as well.