Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
francois_974
Contributor III
Contributor III

create a specific variable or a fiels in scrip

Hello

first, sorry for my english . i will try to be clear

 i have a table like below in my script.  I need to treat specific data and exclude one service like this  : 

- sum("Mt Sortie (mvs)") of this particular service = '6423' as "MtSortiebonimali"

and

- sum("Mt Sortie (mvs)") of the service - = '6423' as "MtSortieUF" 

in chart , i've done :

sum({$<[No UF (mvs)]= {6423}>}[Mt Sortie (mvs)]) and sum({$<[No UF (mvs)]-= {6423}>}[Mt Sortie (mvs)])

it is ok but i need to use very often this particular calcul and it's complicate for certain treatements.

example : when i want to make a top 10 for my article i don't know how to do. something like this dont works

Sum({<[No UF (mvs)]= {"=Rank(Sum([Mt Sortie (mvs)])) <=20"} - {"6423"}>} [Mt Sortie (mvs)]) 

i try to make 2variables without succès and i can't put a set analys in a script.. 

Very thanks for your helps

 

AllMouvements:
LOAD
"Magasin (mvs)",
"Libellé magasin (mvs)",
"Type (mvs)",
"code - libellé pole (po)",
"No UF (mvs)" as Service,
"libelle Uf - code UF (uf)",
"No Produit (pr)",
"Libelle1 Produit (pr)",
"Libelle2 Produit (pr)",
"Compte Ordonnateur (pr)",
"Libellé Compte",
"Date Mouvement (mvs)"as Date,
"Qté Mvt (mvs)",
"Mt Sortie (mvs)",
"No Fournisseur (fr)",
if ([No UF (mvs)]< 6000,'EPSMR','CHOR') as Etablissement

FROM [lib://Magasin:DataFiles/_All MouvementsStock1.xlsx]
(ooxml, embedded labels, header is 1 lines, table is Mouvements) Where "Type (mvs)"='S';

Labels (3)
2 Solutions

Accepted Solutions
MayilVahanan

Hi @francois_974 

Try like below

Sum({<[No UF (mvs)]= {"=Rank(Sum({<[No UF (mvs)]-={"6423"}>}[Mt Sortie (mvs)])) <=20"} >} [Mt Sortie (mvs)]) 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

Hi @francois_974 

Try like below

Sum({<[No UF (mvs)]= {"=Rank(Sum({<[No UF (mvs)]-={"6423"}>}[Mt Sortie (mvs)])) <=20"} >} [Mt Sortie (mvs)]) 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
francois_974
Contributor III
Contributor III
Author

Thanks

it works

good afternoon

francois_974
Contributor III
Contributor III
Author

Thanks

it take a look

good afternoon