Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hola, soy nuevo en Qlik
Quisiera saber como hacer un set analysis con 2 dimensiones de tiempo entre un YearToDate y un LastYearToDate, si es que esto es posible. Hice lo mismo pero con AÑO y si me salió pero ahora quiero hacerlo con el MES
Actualmente tengo esto:
YTD
Sum({<Year={$(=Max(Year))}>} [Monto Mn Bruto SKU])
LYTD
Sum ({<Year={$(=Max(Year)-1)}>}[Monto Mn Bruto SKU])
Quiero que al filtrar el mes también me de los datos comparados ya que no lo sucede así. Espero me puedan ayudar
No, the filtering must be done on the same field, the above comparison with year field will look like
Yearfield = {">=2022-01-01<=2022-05-25"}
now Yearfield has values 2022,2021,2020 etc these are not comparable to date values 2022-01-01, 2022-01-02 etc
makes sense??
You need to filter on the Datefield to filter dates
the Yearfield to filter Year
or the month field to filter months
refer this
https://community.qlik.com/t5/Qlik-Design-Blog/Dates-in-Set-Analysis/ba-p/1472511
Current Year YTD
Sum({<Date = {">=$(=Date(yearstart(Max(Date)),'YYYY-MM-DD'))<=$(=Date(Max(Date),'YYYY-MM-DD'))"} >} [Monto Mn Bruto SKU])
Previous Year YTD
Sum({<Date = {">=$(=Date(yearstart(Max(Date),-1),'YYYY-MM-DD'))<=$(=Date(addyears(Max(Date),-1),'YYYY-MM-DD'))"} >} [Monto Mn Bruto SKU])
Hi Vinie
When l use it, now change me the amount
the comment apply only for the year and already gives me the correct amount but when i try this new one, the amount gives me the Total amount but not the YTD and and LYTD, what lm doing wrong?
Thanks for help me!
Hi, you need to refer the DateField name in your data,.
Replace Datefield from below to the DateField name in your data
Replace YYYY-MM-DD, to match the date format of your datefield
Current Year YTD
Sum({<Datefield = {">=$(=Date(yearstart(Max(Datefield)),'YYYY-MM-DD'))<=$(=Date(Max(Datefield),'YYYY-MM-DD'))"} >} [Monto Mn Bruto SKU])
Previous Year YTD
Sum({<Datefield = {">=$(=Date(yearstart(Max(Datefield),-1),'YYYY-MM-DD'))<=$(=Date(addyears(Max(Datefield),-1),'YYYY-MM-DD'))"} >} [Monto Mn Bruto SKU])
Hi,
So that Datafield in this case could be my Year ?
I will try this changing my date format because on DB comes DD-MM-YYYY, so if l try this, is correct?
Sum({<Year = {">=$(=Date(yearstart(Max(Year)),'DD-MM-YYYY'))<=$(=Date(Max(Year),'DD-MM-YYYY'))"} >} [Monto Mn Bruto SKU])
No, the filtering must be done on the same field, the above comparison with year field will look like
Yearfield = {">=2022-01-01<=2022-05-25"}
now Yearfield has values 2022,2021,2020 etc these are not comparable to date values 2022-01-01, 2022-01-02 etc
makes sense??
You need to filter on the Datefield to filter dates
the Yearfield to filter Year
or the month field to filter months
refer this
https://community.qlik.com/t5/Qlik-Design-Blog/Dates-in-Set-Analysis/ba-p/1472511