Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bhargav_bhat
Creator II
Creator II

Getting Previous N Product IDs data in Pivot table with calculated dimension

Hi All,

we have a requirement where the user wants previous 'N'  no of ProductID when he selects a particular productID. He will provide the value of N using variable extension.

This we were able to achieve if the dimension is only Product ID but if we use calculated dimension as Pick(Dim, ProductID, 'Variance') then we get previous ProductID values as null as shown below

Pivot.PNG

we tried adding Previous ProductID is set analysis

Sum({<ProductID={1,2,3,4,5}>}Amount)

Also we tried ignoring the PRoductID filter

Sum({<ProductID=>}Amount)

but we were getting null values

Is there any workaround to achieve this

I have attached sample app for reference

Regards,

Bhargav

3 Replies
Anil_Babu_Samineni

Looks like you've updated. Perhaps try this?

Pick(Dim, Sum({<ProductID={1,2,3,4,5}>}Amount))

don't create duplicate https://community.qlik.com/message/1415444

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
bhargav_bhat
Creator II
Creator II
Author

Hi Anil,

Thanks for replying but thats not working 

And its a different issue

Regards,

Bhargav

Anil_Babu_Samineni

What this Variance calculated? Normally, When we are working rule from island table it should be calculate 2 measures. Which is

Pick(Dim, Sum({<ProductID={1,2,3,4,5}>}Amount), 'Here Variance statement')

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