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: 
kushalthakral
Creator III
Creator III

Help required in script

Dear All

I have a few requirement that i want to achieve at script level

i have following Tables:

Model     Price

a               10

b               20

c               30

a               10

a               10

b               20

c               30

c               30

One more table like

Model  Sub-Category

a               d

a               e

a               f

now i want to achieve following output

Model  Sub-Category  Contribution

a           d                        count(model a)/count(model a +b)

a           e                          count(model a)/count(model a +b)

a           f                            count(model a)/count(model a +b)

Thanks

Kushal Thakral

1 Reply
swuehl
MVP
MVP

Your counts are the same for all model lines of table2?

Then try

Table1:

LOAD * INLINE [

Model,     Price

a,               10

b,               20

c,               30

a,               10

a,               10

b,               20

c,               30

c,               30

];

Table2:

LOAD * INLINE [

Model,  Sub-Category

a,               d

a,               e

a,               f

];

JOIN LOAD

count(if(Model='a',Model)) / count(if(Model='a' or Model='b',Model)) as Count

Resident Table1;