Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have an issue regarding a division in my qlikview app/script
I tried to to that:
ALT(((SUM(FLUX_PIECES_POIDS_PLASTIQUE) * SUM(QTY_ON_HAND))/SUM(SALES_MULTIPLE)),0) as PIECES_POIDS_EMBALLAGE_PLASTIQUE, //Poids emballage pièce plastique
ALT(((SUM(FLUX_PIECES_POIDS_CARTON) * SUM(QTY_ON_HAND))/SUM(SALES_MULTIPLE)),0) as PIECES_POIDS_EMBALLAGE_CARTON, //Poids emballage pièce plastique
ALT(((SUM(FLUX_PIECES_POIDS_BOIS) * SUM(QTY_ON_HAND))/SUM(SALES_MULTIPLE)),0) as PIECES_POIDS_EMBALLAGE_BOIS //Poids emballage pièce plastique
But as a result i always get zero values.
I don't understand what i did wrong.
Of course i used a group by.
Even if i don't use aggregation and group by i get zero as a result from these 3 calculated measure. Anyone could help please.
Thanks
Did you try looking at the values individually?
ALT(((SUM(FLUX_PIECES_POIDS_PLASTIQUE) * SUM(QTY_ON_HAND))/SUM(SALES_MULTIPLE)),0)
SUM(FLUX_PIECES_POIDS_PLASTIQUE) as tmp1,
SUM(QTY_ON_HAND) as tmp2,
SUM(SALES_MULTIPLE) as tmp3,
ALT(((SUM(FLUX_PIECES_POIDS_PLASTIQUE) * SUM(QTY_ON_HAND))/SUM(SALES_MULTIPLE)),0) as PIECES_POIDS_EMBALLAGE_PLASTIQUE
You will get 0 in three scenarios
1) If tmp1 is 0 or
2) if tmp2 is 0 or
3) if tmp3 is 0
Do you see any rows where all three tmp1, tmp2, tmp3 are not 0 at the same time?
Anyone ???
Did you try looking at the values individually?
ALT(((SUM(FLUX_PIECES_POIDS_PLASTIQUE) * SUM(QTY_ON_HAND))/SUM(SALES_MULTIPLE)),0)
SUM(FLUX_PIECES_POIDS_PLASTIQUE) as tmp1,
SUM(QTY_ON_HAND) as tmp2,
SUM(SALES_MULTIPLE) as tmp3,
ALT(((SUM(FLUX_PIECES_POIDS_PLASTIQUE) * SUM(QTY_ON_HAND))/SUM(SALES_MULTIPLE)),0) as PIECES_POIDS_EMBALLAGE_PLASTIQUE
You will get 0 in three scenarios
1) If tmp1 is 0 or
2) if tmp2 is 0 or
3) if tmp3 is 0
Do you see any rows where all three tmp1, tmp2, tmp3 are not 0 at the same time?
Yes indeed i looked at the valuesindividually and i notice an issue.
It was an issue regarding a left join which wasn't working right that's why i had no values.
Thanks a lot