Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Create table for all values matching only 1 comparison field value

I've got an expression problem I'm looking for some help with.

My data looks like:

field_counter|week_num
z |4
x |4
y |3
x |3
y |2
x |2
y |1
x |1


New week data is continually added. I want to create a table filtered for those fields appearing in the +latest week only+, i.e. newly used fields. In the above case that would be 'z'.

I can get a count using:

Count({<field_counter = e({<week_num -= {'$(=MaxString(week_num))'}>} field_counter)>} DISTINCT field_counter)

And create a table filter using (where the latest week is '4'):

=aggr(if(match(week_num, '1', '2', '3')=0, field_counter),field_counter)

But I need to replace the hardcoded list of prior weeks with, essentially, 'all weeks that are not MaxString(week_num)'. Tried 'not match' and 'only' with no luck.

Labels (5)
1 Solution

Accepted Solutions
Highlighted

How about this

=Aggr(Only({<field_counter = e({<week_num -= {'$(=MaxString(week_num))'}>} field_counter)>} field_counter), field_counter)

View solution in original post

4 Replies
Highlighted

Can you explain the highlighted part of the expression

Count(<field_counter = e({<week_num -= {'$(=MaxString(week_num))' <GO>>} field_counter)>} DISTINCT field_counter)

Is this expression even working for you?

Highlighted
Contributor
Contributor

sorry, fixed that now
Highlighted

How about this

=Aggr(Only({<field_counter = e({<week_num -= {'$(=MaxString(week_num))'}>} field_counter)>} field_counter), field_counter)

View solution in original post

Highlighted
Contributor
Contributor

great, thanks, that produces the same output