Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Xolink1389
Creator
Creator

Ordenas drop de fechas

Hola tengo un problema con un drop

Xolink1389_0-1668537078517.png

genere las fechas con un calendario maestro, la cuestion es que me esta ordenando por dias, y yo quiero que me los orden por año y mes,  para que todo lo de un mismo año salga junto, es posible, estoy usando el siguiente codigo

calendario:
LET vDateMin = Num(MakeDate(2020,1,1));
LET vDateMax = Floor(Today());

TempCalendar:
LOAD $(vDateMin) + RowNo() - 1 as DateNumber,
Date($(vDateMin) + RowNo() - 1) as TempDate
AUTOGENERATE 1
WHILE $(vDateMin) + IterNo() - 1<= $(vDateMax);

Calendario:
LOAD
Year(TempDate) as Año,
Month(TempDate) as Mes,
Year(TempDate)&num(Month(TempDate),'00') as AñoMes,
Dual(Month(TempDate)&'-'&Right(Year(TempDate),2),
Year(TempDate)&num(Month(TempDate),'00')) AS [Mes-Año],
Day(TempDate) as Dia,
Num(TempDate) as NumMes,
date(TempDate) as Fecha,
date(MonthEnd(TempDate)) as FechaInicio
Resident TempCalendar
Order By TempDate Asc;

Ciclo:
Load
max(Dia) as nomes,
FechaInicio as dateSelect
Resident Calendario
Group by FechaInicio
Order by AñoMes,Dia asc;

 

De ante mano, gracias comunidad, saludos.

 

Labels (5)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

try below

 

=concat(distinct dateSelect,'|',dateSelect)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

4 Replies
vinieme12
Champion III
Champion III

which field is this screenshot for?  

the field fecha will sort correctly 

 

what is the purpose of the field dateSelect?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Xolink1389
Creator
Creator
Author

lo usamos para poder hacer un filtro con esta expresion

=If(len(if(Aggr(date([Fecha Doc.],'DD/MM/YYYY'), key) <= date('$(vFechaInput)', 'DD/MM/YYYY') 
        	AND Sociedad = '$(vSociedad)' 
            	AND If(Mid([Cta.Mayor],5,3) = '190', [Cta.Mayor] = Replace('$(vCuentaMayor)',100,190), 
                	if(Mid([Cta.Mayor],5,3) = '180',[Cta.Mayor] = Replace('$(vCuentaMayor)',100,180),[Cta.Mayor])) 
                    	AND FechaComp > num(date('$(vFechaInput)', 'DD/MM/YYYY')), key), )>0, ConceptoClase2)

 

el valor del drop que usamos es este

Xolink1389_0-1668609545310.png

Concat(distinct dateSelect, '|')

Xolink1389_1-1668609557409.png

 

 

vinieme12
Champion III
Champion III

try below

 

=concat(distinct dateSelect,'|',dateSelect)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Xolink1389
Creator
Creator
Author

thanks!! it work!! 😊