Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i have those two variables:
Set vAnnoTempo = GetFieldSelections(ANNOTEMPO);
Set vMeseTempo = GetFieldSelections(MESETEMPO);
ANNOTEMPO and MESETEMPO are fields of my TIME_TABLE
i want those variables takes from my fields selection:
When i choose for example Anno: 2017 Mese: 2
I want my chart will be filter from my vAnnoTempo and vMeseTempo, but its not start
The set analisys expression i have in my chart is:
=Sum({<ANNO_IN={"=$(vAnnoTempo)"},MESE_IN={"=$(vMeseTempo)"}>} CONSUMO_TOT_ANNUO)
ANNO_IN and MESE_IN are my fields in my CONTR table.
p.s.: CONTR table and TIME_TABLE are not connected, and this is correct, i not want are connected, i want do my filter with set analisys in this way, becouse for every dimension i have in my chart i need to do a different set analisys
Thanks
i can't upload the example
try to copy and paste the above code
It not works... if i choose month 12, 3 it show me 150 but it need show me only 100 becouse it have the max date for this punto: PR01
here is the result I have (100)
sure, you choose only 12....
you need to choose 12 and 3 for "mesetempo"
or if you want choose only one month like 12 use this:
t:
load * inline [
ANNO_IN,MESE_IN,COD_PUNTO,DATA_IN,CONSUMO_TOT_ANNUO
2018,12,PR01,10/10/2018,100
2018,12,PR01,12/10/2018,200
2018,3,PR01,4/10/2018,50
2018,1,PR02,10/10/2018,300
];
and for result in this case you must to have 200 (not 300)
in fact you need the product with the highest date AND the rows of this highest date ....
=Sum({<
COD_PUNTO=P({<DATA_IN={'$(=date(Max(DATA_IN),'DD/MM/YYYY'))'}>}COD_PUNTO),
DATA_IN={'$(=date(Max(DATA_IN),'DD/MM/YYYY'))'}
,
ANNO_IN={'$(=GetFieldSelections(ANNOTEMPO))'},MESE_IN={'$(=Concat(GetFieldSelections(MESETEMPO, chr(39) & ',' & chr(39))))'}>} CONSUMO_TOT_ANNUO)
With this new expression you write it works!!! thanks.... but... if i choose mesetempo=3 it not show me nothing...
of course,
DATA_IN={'$(=date(Max(DATA_IN),'DD/MM/YYYY'))'}
retrieves the highest date of all the table
you have to modify it if you want to xconsider only the selections you made
But no sorry... like i say from the first time i need an expression to take me the Max date of every "cod_punto"
ok i understood is impossible to do it in Qlik, really thank you very much for your time Oliver
well, impossible is not qlik
but for the moment I don't have the good idea to resolve you case
sorry