Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis for max function

I have a table that contains records that I would like to pull based on user input

The two fields in particular that I would like to use to get my value is fiscal_year and yr_prd

I have a variable that the user will enter a value for called vFiscalYr.

I need to have the set analysis pull the record that contains the fiscal year the user entered but it must pull the max for yr_prd.

The field that I want to display is called beg_balance.

how can I set this up in set analysis to pull the beg_balance based on the max yr_prd for a specific year????

1 Solution

Accepted Solutions
maxgro
MVP
MVP

sum({$ <fiscal_year={$(vFiscalYr)},yr_prd={$(=max(yr_prd))}>} beg_balance )

View solution in original post

4 Replies
sunny_talwar

Getting a little confused here, what is yr_prd here and how it is related to fiscal_year?? Can you provide some sample data with expected output?

Best,

S

maxgro
MVP
MVP

sum({$ <fiscal_year={$(vFiscalYr)},yr_prd={$(=max(yr_prd))}>} beg_balance )

Not applicable
Author

sunindia

here is a sample of the table.

so if the user enters 2014

then it should pull $494.76 since this is the max yr_prd for 2014.

I'm trying to pull the Current_Yr_Depreciation.(sorry, I think I said begBalance earlier but it's Current_Yr_depreciation)

     

Item Fiscal_YearBegBalanceBegDepreciationYR_PRDCurrent_Yr_Depreciation
162392014$0.00 $3,591.00 201401$41.23
162392014$0.00 $3,591.00 201402$82.46
162392014$0.00 $3,591.00 201403$123.69
162392014$0.00 $3,591.00 201404$164.92
162392014$0.00 $3,591.00 201406$247.38
162392014$0.00 $3,591.00 201407$288.61
162392014$0.00 $3,591.00 201408$329.84
162392014$0.00 $3,591.00 201409$371.07
162392014$0.00 $3,591.00 201410$412.30
162392014$0.00 $3,591.00 201411$453.53
162392014$0.00 $3,591.00 201412$494.76
162392015$0.00 $3,591.00 201501$0.00
162392015$0.00 $3,591.00 201502$0.00
maxgro
MVP
MVP

sum({$ <Fiscal_Year={$(vFiscalYr)},YR_PRD={"$(=max({1 <Fiscal_Year={$(vFiscalYr)}>} YR_PRD))"}>} Current_Yr_Depreciation )