Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gerrycastellino
Creator III
Creator III

set expression help

I'm trying to formulate a set expression that gives me the sum of sales for my QTD for my current year.

=sum( {$<[Transaction Fiscal Year] = {$(=max([Transaction Fiscal Year]))},  

         [Transaction Fiscal Quarter] = {$(=max([Transaction Fiscal Quarter]))} >} sales  )

I have to add a year modifier to get me the sales for the latest year/latest quarter, I've not structure this the right way.

Gerry.

2 Replies
Gysbert_Wassenaar

Perhaps like this:

=sum( {$<[Transaction Fiscal Year] = {$(=max([Transaction Fiscal Year]))}, 

         [Transaction Fiscal Quarter] = {$(=max({$<[Transaction Fiscal Year] = {$(=max([Transaction Fiscal Year]))}>}[Transaction Fiscal Quarter]))} >} sales  )

If not, please post a small qlikview document that demonstrates the problem.


talk is cheap, supply exceeds demand
jafari_ervin
Creator III
Creator III

I think you can create field "[Transaction Fiscal Year]&[Transaction Fiscal Quarter] as Transaction_Fiscal_YearQuarter "

in your edit script, then set the variable that calculated the maximum YearQuarter like below

V_MaxYearQuarter = max(Transaction_Fiscal_YearQuarter)

if you want to calculated the max Year Quarter at all you can use "All" keyword :

V_MaxYearQuarter = max(all Transaction_Fiscal_YearQuarter)

at the end your expression should be like this

sum({<Transaction_Fiscal_YearQuarter  = {$(V_MaxYearQuarter)}>}sales )