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: 
Anonymous
Not applicable

Group by

Header 1Header 2Header 3Header 4Header 5
IDCOUNTLOCATIONSIGRVALUE
AA2301UK1000045000
AA2302UK1500056000
AA2303UK50065000

Hi ,

I want create a range from sigr where the Count = Max(count) . Now with the condition satisfied  I would have something like this ;

Header 1Header 2Header 3Header 4Header 5Header 6
RANGE FIELDIDCOUNTLOCATIONSIGRVALUE
AAA2303UK50065000

But actually I would want the summation of all the figures in the value field for  the range band and the script below is not giving me the result.

Temp_Table:

Load * from Temp_Table;

Left join(Temp_Table)

Load ID,

Max(Count) as CountTemp

sum(Value)

resident Temp_Table group by ID;

Load *,

IF(SIGR <= 99999 AND COUNT = CountTemp  ,'A',

IF( SIGR > 99999 AND  SIGR <= 49999 AND COUNT=CountTemp ,'B' )) as RangeField

resident Temp_Table;

Drop table Temp_Table;

Drop field CountTemp;

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Replace FirstSortedValue(VALUE,-COUNT) as VALUE_2 wtih sum(VALUE) as VALUE_2


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi @

Thanks for that but i had wanted the VALUE2 to be the summation of all numbers in VALUE FIELD

eg. VALUE2 =45000 + 56000 +65000 = 168000

Thanks

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Replace FirstSortedValue(VALUE,-COUNT) as VALUE_2 wtih sum(VALUE) as VALUE_2


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Funny I did same in the script but hey thanks