Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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;