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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
lockematthewp
Creator II
Creator II

Formula in Set Analysis

=Num(Sum(
{$<[Data Type(B)] = {'eForecast Hrs System'}>
*$<[Data Classification(B)] = {MaxString([Data Classification(B)])}> }
Hours),'#,##0.00')

I need help with this expression. Specifically the second part with the Data Classification. I intend for the formula to choose the latest value for Data Classification (F1, F2, etc...). This part of the formula works in a text box but I am unable to find the right format for the set analysis.

Thanks,

Matt

Labels (1)
1 Solution

Accepted Solutions
bharathadde
Creator II
Creator II

Try this

=Num(Sum(
{$<[Data Type(B)] = {'eForecast Hrs System'}
,[Data Classification(B)] = {'$(=MaxString([Data Classification(B)]))'}> } 
Hours),'#,##0.00')

The only change I did is including $ sign before maxstring. In qlikview if you need to include a formula in set analysis we need to use $(=Formula) otherwise it will just take it as a String.

"=MaxString([Data Classification(B)])" taken as string =MaxString([Data Classification(B)])

'$(=MaxString([Data Classification(B)]))' gives you max value

View solution in original post

3 Replies
jwjackso
Specialist III
Specialist III

=Num(Sum(
{$<[Data Type(B)] = {'eForecast Hrs System'}
,[Data Classification(B)] = {"=MaxString([Data Classification(B)])"}> } 
Hours),'#,##0.00')

lockematthewp
Creator II
Creator II
Author

This format is valid but it is always returning 0. It works if I manually type in a value instead of the =MaxString.

bharathadde
Creator II
Creator II

Try this

=Num(Sum(
{$<[Data Type(B)] = {'eForecast Hrs System'}
,[Data Classification(B)] = {'$(=MaxString([Data Classification(B)]))'}> } 
Hours),'#,##0.00')

The only change I did is including $ sign before maxstring. In qlikview if you need to include a formula in set analysis we need to use $(=Formula) otherwise it will just take it as a String.

"=MaxString([Data Classification(B)])" taken as string =MaxString([Data Classification(B)])

'$(=MaxString([Data Classification(B)]))' gives you max value