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: 
jagdishbr
Contributor III
Contributor III

Get Max of Period

Hi 

I'm new Qlik and developing dashboard and i'm stuck with below task

I have dimension called period consists values (FY22, FY23, 1H22, 1H23) and want to take max of period column value. 

The desired output should be FY23

Is there a way to achieve this in Qlik sense

 

Labels (5)
1 Solution

Accepted Solutions
jagdishbr
Contributor III
Contributor III
Author

Hi RolfG,

Thanks for your effort in resolving the query. solution provided by you is partially helped. however below function helped to me achieve required output.

MaxString(
If(
WildMatch(SurveyPeriod, '*FY*') or WildMatch(SurveyPeriod, '*1H*'),
SurveyPeriod
)
)

View solution in original post

2 Replies
RolfG
Contributor II
Contributor II

Hi,

if you have text values representing a sortable dimension, you can load them with the DUAL command, in your case creating an integer consisting of the year and the "Type" as

DUAL(<value>,num(right(<value>,2))*10+if(left(<value>,2='FY',2,1))) AS Dimension

The result will be sorted by the year, than the type, as it creates for your sample (hidden) numerical values:

FY22 -> 222

FY23 -> 232

1H22 -> 221

1H23 -> 231

 

 

jagdishbr
Contributor III
Contributor III
Author

Hi RolfG,

Thanks for your effort in resolving the query. solution provided by you is partially helped. however below function helped to me achieve required output.

MaxString(
If(
WildMatch(SurveyPeriod, '*FY*') or WildMatch(SurveyPeriod, '*1H*'),
SurveyPeriod
)
)