Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
principal
Luminary Alumni
Luminary Alumni

Set Analysis Issue using Sum

Hi All,

I have the following expression, I basically want a table where the Pallet Expected Qty is less than the Stock Cases, so it's not a full pallet of stock

 

NUM(SUM({<[Product Pick Type] = {'PALLET'},[Product Cases Per Pallet] = {"=[Product Cases Per Pallet]) > SUM([Stock Cases])"}>}[Stock Cases]),$(format.number))

Can anyone suggest why the above expression is not returning the correct result, I would have thought the above would have worked

Thanks.

Labels (2)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

Perhaps this?

SUM({<[Product Pick Type] = {'PALLET'}, [Product Cases Per Pallet]={"=Sum([Product Cases Per Pallet])>=Sum([Stock Cases])"}>} [Stock Cases])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

9 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:
=NUM( SUM( {< [Product Pick Type] = {'PALLET'},
[Product Cases Per Pallet] = {">$(=Sum([Stock Cases]))"} >} [Stock Cases] ),
$(format.number) )

i hope it helps.

Anil_Babu_Samineni

Please remove red part from below and then try?

NUM(SUM({<[Product Pick Type] = {'PALLET'},[Product Cases Per Pallet] = {"=[Product Cases Per Pallet]) > SUM([Stock Cases])"}>}[Stock Cases]),$(format.number))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
principal
Luminary Alumni
Luminary Alumni
Author

Hi,

Thanks for that, however that only returns 1 record in the table, there are 120 records that need to be returned.

Regards

Alan.

Anil_Babu_Samineni

I would suggest start testing step-step

1) Sum([Stock Cases])

2) Sum({<[Product Pick Type]={'PALLET'}>} [Stock Cases])

3) Please validate manually from 1st point and adding the measure 2nd point

4) Please check manual entry for data point in table?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
principal
Luminary Alumni
Luminary Alumni
Author

Hi,

I have done that, as you can see from the screenshot below, it only returns the first value of 30, but all values should show as the qty's are less than the Pallet Qty

ticket.png

Anil_Babu_Samineni

Please attach QVW with sample data set to check?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
principal
Luminary Alumni
Luminary Alumni
Author

see the attached file, thanks

Anil_Babu_Samineni

Perhaps this?

SUM({<[Product Pick Type] = {'PALLET'}, [Product Cases Per Pallet]={"=Sum([Product Cases Per Pallet])>=Sum([Stock Cases])"}>} [Stock Cases])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
principal
Luminary Alumni
Luminary Alumni
Author

That's it, thanks for your help