Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
Showing results for 
Search instead for 
Did you mean: 
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.


2 Replies
MVP & Luminary
MVP & Luminary

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
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 )