Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable question

Hi - I'm looking for a simpler way to do the following.  I want to look at data from all transactions with a certain SKU # in the transaction.  My current formula is:

SUM({$<TRANSACTION_KEY = P({1<SKU = {'5476024'}>} [TRANSACTION_KEY])>} NET_SALES)

I would like to use an input box to input the SKU number rather than type it in the formula, but this type of formula doesn't seem to allow it.  What is the best way to handle this?  I may be over-complicating this as well, so any suggestions for simplicity works too.  Thank you - Matt

1 Solution

Accepted Solutions
maxgro
MVP
MVP

variable in input box vsku

expression

=SUM({$<TRANSACTION_KEY = P({1<SKU={$(vsku)}>} [TRANSACTION_KEY])>} NET_SALES)

View solution in original post

3 Replies
avinashelite

Hi

1:create a variable first like vInput.

2:Then use the same variable in INPUT box

3:try the expression like this:

SUM({<TRANSACTION_KEY = p([TRANSACTION_KEY],SKU ='$(vInput)' >} >} NET_SALES)

maxgro
MVP
MVP

variable in input box vsku

expression

=SUM({$<TRANSACTION_KEY = P({1<SKU={$(vsku)}>} [TRANSACTION_KEY])>} NET_SALES)

Not applicable
Author

Perfect - works like I was hoping.  Thank you both!