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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
gz
Creator
Creator

division result for two dimensions

I have two tables, in the first one the dimension is Miesiac_Rok_data_aktywacji and the measure is the sum of commissions. In the second table, the dimension is Miesiac_Rok_data_wplaty and the measure is the sum of commissions. I would like to see what percentage the commission for the Month_Year_data_activation dimension is in the commission for the Month_Year_data_wplaty dimension. For the current month I use a variable and an expression
Sum({<czy={'Poza'},
id_zrodlo_debt={'1','28'},
sprawa_testowa_debt={'False'},
Miesiac_Rok_data_aktywacji={"$(vCurrentMonthYear)"},
wystawca={'company'}
>} If(data_aktywacji = max_data_aktywacji
and Miesiac_Rok_data_wplaty = Miesiac_Rok_data_aktywacji
and data_aktywacji = max_data_aktywacji,
prowizjaPoPrzeliczeniu))
/
Sum({<czy={'Poza'},
id_zrodlo_debt={'1','28'},
sprawa_testowa_debt={'False'},
Miesiac_Rok_data_wplaty={"$(vCurrentMonthYear)"},
wystawca={'company'}>}prowizjaPoPrzeliczeniu)
it shows me 8.32%. I would like the same for the remaining months where the dimension would be Miesiac_Rok_data_aktywacji

gz_0-1727270310627.png

 

first part will be 
Sum({<czy={'Poza'},
id_zrodlo_debt={'1','28'},
sprawa_testowa_debt={'False'},
wystawca={'company'}
>} If(data_aktywacji = max_data_aktywacji
and Miesiac_Rok_data_wplaty = Miesiac_Rok_data_aktywacji
and data_aktywacji = max_data_aktywacji,
prowizjaPoPrzeliczeniu))

but i have problem with second part
Sum(
{<czy={'Poza'},
id_zrodlo_debt={'1','28'},
sprawa_testowa_debt={'False'},
wystawca={'company'}>}
TOTAL <Miesiac_Rok_data_wplaty> prowizjaPoPrzeliczeniu
)
or 
Sum(
{<czy={'Poza'},
id_zrodlo_debt={'1','28'},
sprawa_testowa_debt={'False'},
wystawca={'company'},
Miesiac_Rok_data_wplaty = p(Miesiac_Rok_data_aktywacji)>} 
prowizjaPoPrzeliczeniu
)
they don't give me the correct result

Labels (3)
2 Replies
gz
Creator
Creator
Author

can I modify the expression so that the sum is for dimension Miesiac_Rok_data_wplaty even though I use dimension Miesiac_Rok_data_aktywacji ?

Kushal_Chawda

@gz  You should have common month dimension to do so. You many need to create canonical date calendar. Please see the link below

https://community.qlik.com/t5/Design/Canonical-Date/ba-p/1463578