Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik community, I'm new here
I'm trying to do this in a chart
When I use a string in a counter
Count({<[Gerencia]={'Abogados'},FecEval={'1/10/2018'},[Cla1]={'Abogado'}>} Sexo)
The counter works great. but, when I change '1/10/2018' with a variable (vAñoMaximo) dont work
Variable definition:
vAñoMaximo=if(GetSelectedCount(FecEval)=0,Max(FecEval),GetFieldSelections(FecEval))
I try with this options without a good result
I hope you can help me.
That's exactly the question... I tried to many permutations of code to convert the data without a good result...
I solve the issue creating a new field with a tag of the last date compared.
Thx for your time.
Podrías intentar algo así
LET vMaxYear = Year(Today() );
Count({<[Gerencia]={'Abogados'},FecEval={'vMaxYear' },[Cla1]={'Abogado'}>} Sexo)
Or
Load
Year(date) as Year
Select * from table;
Expression
Count({<Gerencia]={'Abogados'},Cla1={'Abogado'}, year= {$(=max(Year))}>}Sexo)
Take a look at the output of your variable vAñoMaximo. You need to make it to contain the date presented as text and not an integer.
SET modifiers always evaluate against the string part of an dual. A date field (eg FecEval) consist of a string and a numeric value. Your date 1/10/2018 is the string representation of the numeric value 43374.
There is a important diffrence between the two expressions below.
Count({<[Gerencia]={'Abogados'},FecEval={'1/10/2018'},[Cla1]={'Abogado'}>} Sexo)
Count({<[Gerencia]={'Abogados'},FecEval={'43374'},[Cla1]={'Abogado'}>} Sexo)
That's exactly the question... I tried to many permutations of code to convert the data without a good result...
I solve the issue creating a new field with a tag of the last date compared.
Thx for your time.
Gracias mario pero en efecto el tema es como lo menciona el colega Vegar, es un tema de comparación dado que la fecha puede ser vista como un número equivalente... sin embargo realicé varias permutaciones para transformar y homogeneizar la data sin exito. Lo solucioné creando un campo en el que se registra la ultima fecha comparada.
Gracias por tu tiempo.