Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Nawfal-Franke
Contributor III
Contributor III

Copy the result of a field to an other field

Hi guys I hope you all are good.

I have a question please I need to copy the result value of a field to other field.

Qlik1.PNG

 Here in this example I need to copy the result of 1197.01 in Cout Total Livraison to all other "BL N°" that have the same "Bon de sortie N°"

and the same the result of 41.59 in Cout Total Livraison to all other "BL N°" that have the same "Bon de sortie N°"

and the same thing with the field Cout Expédition par volume.

Can you please help me on that.

Kind Regards

  

3 Solutions

Accepted Solutions
Lisa_P
Employee
Employee

Try using the NoDistinct qualifier in your expressions.

See link here to article:

https://community.qlik.com/t5/Qlik-Design-Blog/The-nodistinct-qualifier-and-the-Aggr-function/ba-p/1...

Where you have the aggr function, you will need to do only(aggr(nodistinct(sum .......

View solution in original post

DesmoArka
Partner - Contributor III
Partner - Contributor III

try to put nodisinct after aggr not after sum.

I hope this help.

View solution in original post

Nawfal-Franke
Contributor III
Contributor III
Author

it worked for me after add "sum (DISTINCT" to my expression :

sum (DISTINCT(aggr (NODISTINCT(sum (DISTINCT(KILOMETRAGE*[Consomation Par Km]*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]+[Prix Péage A/R])),[Bon de sortie N°])))

Thank you guys for you help I really appreciate it.

Kind Regards

View solution in original post

8 Replies
Lisa_P
Employee
Employee

Can you share your expressions to create these measures.

Nawfal-Franke
Contributor III
Contributor III
Author

Hi Lisa ,

Thanks for your help ;

this is the fist expression :

//Cout Total Livraison

aggr(sum(DISTINCT (KILOMETRAGE*[Consomation Par Km]*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]+[Prix Péage A/R]),[Bon de sortie N°])


&IF ([Nom du livreur]='Messagerie',aggr(sum(DISTINCT(KILOMETRAGE*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]),[Bon de sortie N°]))
&IF ([Nom du livreur]='Client',aggr(sum(DISTINCT(KILOMETRAGE*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]),[Bon de sortie N°]))
&IF ([Nom du livreur]='ACHAT INTERNE',aggr(sum(DISTINCT(KILOMETRAGE*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]),[Bon de sortie N°]))
&IF ([Nom du livreur]='HASSAN LOTFI',aggr(sum(DISTINCT(KILOMETRAGE*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]),[Bon de sortie N°]))
&IF ([Nom du livreur]='IBRAHIM NEJMI',aggr(sum(DISTINCT(KILOMETRAGE*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]),[Bon de sortie N°]))

This is the second expression :

//Cout Expédition par volume

[Cout Total Livraison] / aggr(sum ([Unit Volume]*[Quantity]),[Bon de sortie N°])

 

Kind Regards

Lisa_P
Employee
Employee

Try using the NoDistinct qualifier in your expressions.

See link here to article:

https://community.qlik.com/t5/Qlik-Design-Blog/The-nodistinct-qualifier-and-the-Aggr-function/ba-p/1...

Where you have the aggr function, you will need to do only(aggr(nodistinct(sum .......

Nawfal-Franke
Contributor III
Contributor III
Author

Hi Lisa ,

I try to add NODISTINCT to my expressions here is the example of the first expression

qlik2.PNG but it seems to be a problem I don't  have any result.

Thank you for your help.

Kind Regards

DesmoArka
Partner - Contributor III
Partner - Contributor III

try to put nodisinct after aggr not after sum.

I hope this help.

Nawfal-Franke
Contributor III
Contributor III
Author

Hi DesmoArka, 

Thanks it works for me.

I have a last a question please when I add the nodistinct after aggr I lost the sum of my expression.

qlik3.PNG

In this example I want to calculate the sum of 1197,01 and 41,59 as a total.

this is the expression i have :

qlik4.PNG

Thank you guys for your help.

Kind Regards

DesmoArka
Partner - Contributor III
Partner - Contributor III

try to get all into a rangesum.

Rangesum(aggr(...... ))

even if i don't understand your "&" operator in your formula, this could be a problem in total.

Try.

Nawfal-Franke
Contributor III
Contributor III
Author

it worked for me after add "sum (DISTINCT" to my expression :

sum (DISTINCT(aggr (NODISTINCT(sum (DISTINCT(KILOMETRAGE*[Consomation Par Km]*[Prix du Littre Moyen])+[Frais de déplacement]+[frais de manutention]+[Prix Péage A/R])),[Bon de sortie N°])))

Thank you guys for you help I really appreciate it.

Kind Regards