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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Denchik
Contributor
Contributor

Data distribution

HI All,

I have been searching on the community and have found similar examples but nothing that will quite do what I require.

Benchmark data
load *

inline
[
Product, Type,   P,           Z
Banana, T1,       100,      0.4
Banana, T2,       0,           0.6
];

Formula for distribution
if(Type= 'T1', Sum({<Type= {'T1'}>}P)*only({<Type= {'T1'}>}Z),
         if(Type= 'T2', Sum({<Type= {'T2'}>}P)*only({<Type= {'T2'}>}Z)     ,1))

But I can not distribute where there is no source data.

I will appreciate any help.

Thank You

4 Replies
Anil_Babu_Samineni

Try this?

If(Type= 'T1', Sum({<Type= {'T1'}>} P*Z), If(Type= 'T2', Sum({<Type= {'T2'}>}P*Z), 1))

Or

Pick(Match(Type, 'T1', 'T2')+1, Sum({<Type= {'T1'}>} P*Z), Sum({<Type= {'T2'}>}P*Z), 1)

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
Denchik
Contributor
Contributor
Author

It doesn't work either.

Anil_Babu_Samineni

What is the O/P you want to see? and where are you trying?

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
Denchik
Contributor
Contributor
Author

QlikView 11,20, Summary Table .
Т1 = 100 * 0,4 = 40
Т2 = 100 * 0,6 = 60