Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Quite new in Qlikview. I have a dimension "result" with possible values 'sales', 'cost of sales' and 'gross profit'. Another dimension is the Firm name. Now I want to see the % of each value in the dimension compared to the value when the dimension is Sales. Sum(Saldo)/sum(total Saldo) does not work because then the %
against the total of sales + cost of sales + gross margin is calculated. I have tried with set analysis (SUM(Saldo)/SUM({1<RESULTAAT={"Sales"}>}Saldo)) but this does not work either because then QV calculates only correct for the row where the dimension is indeed 'Sales'.
I hope I make myself clear?! I hoped I could fix the value of the dimension (RESULTAAT = 'SALES') with set analysis, but it does not seem to work because the dimension itself is used in the pivot table.
Firm | Total | Total | Firm A | Firm A | Firm B | Firm B |
RESULTAAT | Saldo | % | Saldo | % | Saldo | % |
Sales | 350 000,00 | 100,00% | 250 000,00 | 100,00% | 100 000,00 | 100,00% |
Cost of Sales | -200 000,00 | -57,14% | -140 000,00 | -56,00% | -60 000,00 | -60,00% |
Gross Margin | 150 000,00 | 42,86% | 110 000,00 | 44,00% | 40 000,00 | 40,00% |
How about this:
Sum(Saldo)/Sum(TOTAL <Firm> {<RESULTAAT = {'Sales'}>} Saldo)
Here is a sample attached
Thanks, it works!
I also have another question. The % Omzet expression I have calculated with your help, this calculates the expression for each firm (dimension) in the column seperately. I Also have calculated an expression which calculates the % for all firms, no matter what firm is selected or what firm is shown in dimension (% Totale groep = +Sum( TOTAL <RESULTAAT> {<Firma={"*"}>} Maandcijfer)/SUM(total{<Firma={"*"},RESULTAAT = {'verkopen z btw'}>}Maandcijfer)).
This also works, so for each firm I get the relative figures against sales (verkopen z btw) in column "% Omzet", and in column "% Totale groep" I get the relative figures for the whole group of firms, so I can compare one firm with the average. Now the problem is that when I select 1 firm (firm A hereunder is selected), Firm B is also shown because the expression "% Totale groep" is always active. In what way I can tackle this?
Thanks in advance
Firma | Totaal | Totaal | Totaal | Firm A | Firm A | Firm A | Firm B | Firm B | Firm B |
RESULTAAT | Saldo | % Omzet | % Totale groep | Saldo | % Omzet | % Totale groep | Saldo | % Omzet | % Totale groep |
verkopen z btw | 3 884 903,76 | 100% | 100% | 3 884 903,76 | 100% | 100% | 0,00 | - | 100% |
kostprijs der verkopen | -3 039 729,20 | -78% | -78% | -3 039 729,20 | -78% | -78% | 0,00 | - | -78% |
BRUTOWINST | 845 174,56 | 22% | 22% | 845 174,56 | 22% | 22% | 0,00 | - | 22% |
diverse opbrengsten xxx | 57 421,77 | 1% | 1% | 57 421,77 | 1% | 1% | 0,00 | - | 1% |
mali/prijsverlagingen/kaart | 5 185,24 | 0% | -1% | 5 185,24 | 0% | -1% | 0,00 | - | -1% |
May be try this (Don't exclude Firma in the numerator)
Sum(TOTAL <RESULTAAT> Maandcijfer)/Sum(TOTAL {<Firma={"*"}, RESULTAAT = {'verkopen z btw'}>} Maandcijfer)
Thank for your answer. But I'm afraid this is not the solution. When I don't include all firms in the numerator, the % of only the selected firm against de total group is calculated.
Is it possible to share a sample with expected output to help you better here?
it's because of
Sum( TOTAL <RESULTAAT> {<Firma={"*"}>} Maandcijfer)/SUM(total{<Firma={"*"},RESULTAAT = {'verkopen z btw'}>}Maandcijfer))
If you are trying to suppress null values in Firma, simply check suppress null values in your dimension as they are already in your dimensions, null values will be ignored and you can take of this part Firma={"*"} from your calculation.
Thanks for your answers.
And it works partially, only the firms (dimension) that are selected (and thus not zero) are shown in the columns but also only these firms (that are selected) are calculated in the total, so the total is not the total of all the firms (because {<Firma={"*"}>} is no longer included.
Why is it not included?