Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
francois_974
Contributor II
Contributor II

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';

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

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

View solution in original post

francois_974
Contributor II
Contributor II

Thanks

it works

good afternoon

francois_974
Contributor II
Contributor II

Thanks

it take a look

good afternoon