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
no, in this way is wrong it return: 0
=Sum({<DATA_IN={'$(=Aggr(Max(DATA_IN), COD_PUNTO))'},ANNOIN={'$(=GetFieldSelections(ANNOTEMPO))'},MESEIN={'$(=Concat(GetFieldSelections(MESETEMPO, chr(39) & ',' & chr(39))))'},STATO_IN={'INGRESSO'}>} CONSUMO_TOT_ANNUO)
p.s.: i ask if you can post your .qvw you did for your example post before
i just typed in the code sent before and created a graph and 2 listboxes .. and i didn't save it !!!!!!
in which table is you field cod_punto ?
do you use it as dimension in your graph ?
ok, sorry for asking
cod_punto and data_in is in the table CONTR
and NOT i not use cod_punto like a dimension in my graph, i want use it only in the set analisys for CONSUMO_TOT_ANNUO
Aggr(Max(DATA_IN), COD_PUNTO returns 1 value per COD_PUNTO (i.e an array of value)
in tour case, you have to retrieve only 1 value, the question is : which one do you want ?
the Max(DATA_IN) i want return only this record for the same cod_punto
do you mean you select COD_PUNTO outside the set analysis (via a listbox for example) ?
in this case, you don't need aggr(,cod_punto) as only 1 code is selected
max(date) will be enough
No, i not select a cod_punto via list box...
with my set analisys i want only came back 1 record with one value to use in the sum, the record with maxdate dt_ini
example table:
ANNO_IN,MESE_IN,COD_PUNTO,DATA_IN,CONSUMO_TOT_ANNUO
2018,12,PR01,10/10/2018,100
2018,3,PR01,4/10/2018,50
2018,1,PR02,300
if i do the set analisys in this table it must take in the SUM consumo_tot_annuo the result: 400
NOT 450
i have some difficulties to understand ....
if you don't care about COD_PUNTO, don't user it in aggr
if you want to select max data_in, use max(data_in) in your set analysis and be careful of the format of the date (you may have to use date(), date#() to format it
thanks, but look at example... i need take the max date about my cod_punto
in example i have 2 cod_punto = PR01
from this 2 rows i need to take only the row with MAX data_in... so the row with consumo_tot_annuo=100
all that need in the sum like the set analisys i did... but it not work
you mean you want only the rows belonging to the COD_PUNTO having max(date) ?
and if there are 2 or more COD_PUNTO ?
so, i think you need
Sum({<COD_PUNTO=P({<DATA_IN={'$(=Max(DATA_IN))'>}),ANNOIN=