Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am trying to calculate sum(sales) of current brand selection and divide it by sum(Sales) for the associated market.
Not sure how to calculate overall sales for a specific market as only Brand is selected( market is not selected) .
i am trying to calculate it as sum(Sales)/ sum(total<Market>sales) where denominator gives me total market value whereas i need to calculate it only for associated market value for the brand selected
Thanks Sovan. Could you please help me understand the expression.
{<Brand=,Market=p(Market)>} selects only those records where the market is the same as the market of the selected brands.
Market = p(Market) will include only the market(s) of the selected brand(s). In other words the Possible values of Market given the selections you made.
Brand= will make sure that Brand will not be filtered so all brands of the market of the selected market will be included.
Thanks a lot. but i was wondering, since brand is a filter we are selecting, cant we write <brand={"$(=Brand)"}> so that it takes the associated market value for the only brand we select?
No, because you want all the brands with the same market. If you fix the value of brand to the selected brand you get ... only the selected brand.
Hello Gysbert,
If I include one more dimension'Country', is it possible to calculate Market Value in that case?
Brand | Country | Brand Value | Market Value |
WC01 | China | 400 | 1200 |
WC01 | India | 200 | 1000 |
WC01 | Germany | 300 | 1400 |
Is the expression : sum({<Brand=,Market=p(Market), Country=p(Country)>} Value) correct?
What are you trying to calculate? The market share over all countries or the market share per country?
BTW, you could first simply test an expression before asking if it is correct. That is part of your job as a qlikview developer. You are ultimately the person responsible for making sure that expressions return correct results so that end users can rely on the information in the qlikview documents they use.
Hello I m trying something complex , like calculating market share (brand value and market value) at country level
your expression gives me market value same for all countries, i want to break it at country level
Market | Brand | Country | Value | |||||
Wildcraft | WC01 | China | 400 | 1200 | ||||
Wildcraft | WC01 | China | 200 | 1000 | Brand value | wc01 | 900 | |
Wildcraft | WC01 | Germany | 300 | 1400 | Market value | wildcraft | 1300 | |
Wildcraft | WC02 | China | 200 | 3000 | ||||
Wildcraft | WC02 | India | 200 | 3000 | At Country level | |||
Brand Value | china | 600 | ||||||
germany | 300 | |||||||
Market value | ||||||||
china | 800 | |||||||
germany | 300 |
On selection of only Brand, To calculate the marketvalue countrywise, i wrote expression
sum({<brand=,MARKET=p(MARKET),COUNTRY=p(COUNTRY)>} VALUES)
which gave me incorrect values 1900 for all countries
EXPECTED | |||
Brand | Country | Market Value countrywise | |
WC01 | China | 1900 | 800 |
WC01 | China | 1900 | 800 |
WC01 | Germany | 1900 | 300 |
Perhaps attached qvw helps.