Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
QFanatic
Creator
Creator

Syntax using FirstSortedValue in set Analysis

Hi

I have a model that contains FY in Dual format (created using Dual(fYear-1 &'/'& fYear, fYear) as FY).

In my Set analysis I want to count Distinct Periods where the PeriodID = max PeriodID for my FY(Financial year)

The syntax looks like this...

count({<Channel = {'Banking App'},CostName={'Prev_Yr_Actuals'},Table_Type = {'Rates'},FY = {'=firstsortedvalue(FY,-PeriodID)'}>}DISTINCT Period)

however, the statement doesnt resolve correctly..it resolves to:

FY={'=firstsortedvalue(FY,-PeriodID)'...

1.How do I correct this? Keep in mind my FY is dual...

2. Can I put this in a variable for re-use? If so - how would the syntax look like?

Much appreciated.

Labels (3)
1 Solution

Accepted Solutions
rwunderlich
MVP
MVP

FY = {"$(=firstsortedvalue(FY,-PeriodID))"}

-Rob

View solution in original post

2 Replies
rwunderlich
MVP
MVP

FY = {"$(=firstsortedvalue(FY,-PeriodID))"}

-Rob

QFanatic
Creator
Creator
Author

Thanks Rob