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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where statements in a pivot table.

Ok, tricky question.

I have a pivot table that we want to show Inventory Types (Shortage, On Hand, Book, Adjusted Books, Sales, etc.) Well, on the table, each one of Inventory types has an Inventory Dollar Amount. How can I add a column on my pivot table that will bring in JUST the dollar amounts where the Inventory Type Code = S for sales, B for books, etc.

Am I over thinking this process? My original thought was to have something like this as the expression for Inventory Sales.

=sum(Current_Year.INV_DOLLAR_AMT) where INV_TYP_CDE = 'S'

But QV tells me there is garbage after my statement.

Any help would be GREATLY appreciated.

Thanks,

Scott

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

It's just a syntax issue. Set analysis is probably the most efficient way to handle this. Here's the set analysis syntax.

sum({<INV_TYP_CDE={'S'}>} Current_Year.INV_DOLLAR_AMT)

View solution in original post

5 Replies
johnw
Champion III
Champion III

It's just a syntax issue. Set analysis is probably the most efficient way to handle this. Here's the set analysis syntax.

sum({<INV_TYP_CDE={'S'}>} Current_Year.INV_DOLLAR_AMT)

Not applicable
Author

In QV you shoud use if statements:

Try this:

sum(if(INV_TYP_CDE = 'S', Current_Year.INV_DOLLAR_AMT))

Regards,

Not applicable
Author

Yeah, that did the trick. Thank you very much! Silly syntax problems...haha.

Not applicable
Author

Set analysis is faster Ricardo. Check this link out:

http://community.qlik.com/forums/p/17188/71371.aspx#71371

Not applicable
Author

Thanks Matt Yes you're right.

Best Regards,