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: 
gerrycastellino
Creator III
Creator III

How do I structure my set analysis to get next item sum

Test1.JPG

1 Solution

Accepted Solutions
sunny_talwar

May be this?

=sum({<Item = {"$(=Item+1)" } >}  Sales)

View solution in original post

7 Replies
sunny_talwar

May be this?

=sum({<Item = {"$(=Item+1)" } >}  Sales)

effinty2112
Master
Master

Try:

=sum({$<Item = {$(=FieldValue('Item', FieldIndex('Item',Only(Item))+1))}>}Sales)

If you pick a single value of Item this expression will return the Sales value of the next Item (in load order) from that selected. So you can have Item values like 1, 5,678,'Jabba the Hut' in your list box.

gerrycastellino
Creator III
Creator III
Author

a follow up question: I have a field as dual as below:

dual('2015-Q4',1) as Survey_Type,

I'm running into issues with this in my set:

Count({ < Survey_Type = {"$(=num(Survey_Type)+1)"} >}[Overall Sat])

sunny_talwar

What if you create another field like this:

LOAD Num(Survey_Type) as Num_Survey_Type;

LOAD dual('2015-Q4',1) as Survey_Type,

FROM....

Count({<Num_Survey_Type = {"$(=Num_Survey_Type + 1)"}>}[Overall Sat])

effinty2112
Master
Master

Try:

=sum({$<Survey_Type= {$(=FieldValue('Survey_Type', FieldIndex('Survey_Type',Only(Survey_Type))+1))}>}[Overall Sat])

If the values of Survey_Type are loaded in the correct order this may work for you.

gerrycastellino
Creator III
Creator III
Author

That worked, but I need to display the 2015-Q4  in my list box as selector.

gerrycastellino
Creator III
Creator III
Author

will use a pick(match)