Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SET ANALYSIS help

I want to compare two year sales, at the same month and same date

ex.

count number of sold items in november this year and compare with sold items sold at the same time last year.

As we have 11. november I want to count number of sold items in november this year = 11 days and

compare with the same amount of days last year i november.

I´ve tried with some help from another thread with something like this

({<year={$(vPreviousYear)},month={$(vMaxMonth)}, day={$(vLastMaxDate)}, itemgroup={75211}>}itemnr)

but this doent work


1 Solution

Accepted Solutions
rubenmarin

OK, Sorry again, this is a long thread and I was (and I still am) a bit rushing.

Check attachment, hope this is want you want.

View solution in original post

27 Replies
ali_hijazi
Partner - Master II
Partner - Master II

ignore selection inside your set analysis on year and month

Year=,Month=

count({<year=,month=, year={"$(vPreviousYear)"},month={"$(vMaxMonth)"}, day={"$(vDay)"}, itemgroup={75211}>}itemnr)

I can walk on water when it freezes
Not applicable
Author

Ali

what do you mean by ignore??

Not applicable
Author

ignore is nothing but irrespective selections of any month (month=;)

Not applicable
Author

Hi Ali

I was a little hasty - I see your expression but this gives me only the count for today()

I want to count for each day in november upto the 11. and the same fore last year

I tried with your example but I dont get the result I want

mehmet_caldak
Partner - Contributor III
Partner - Contributor III

Hi,

your current Set Expression consider just last year today, if you want to calculate for last year month to day you should use the expression below;

({<year={$(vPreviousYear)},month={$(vMaxMonth)}, day ={'<=$(vLastMaxDate)'}, itemgroup={75211}>}itemnr)



ali_hijazi
Partner - Master II
Partner - Master II

then remove the condition on day

count({<year=,month=, year={"$(vPreviousYear)"},month={"$(vMaxMonth)"}, itemgroup={75211}>}itemnr)

I can walk on water when it freezes
Not applicable
Author

Hi Ali

If i remove the DAY condition I will count all the items sold in whole november last year, so I cant compare with the amount of days in november this year which is only 11 days

ali_hijazi
Partner - Master II
Partner - Master II

then add the Year and Month, and day as dimensions to your chart and you can drag the dimension on chart to see values of each day near the day of Nov of last year

I can walk on water when it freezes
Not applicable
Author

go for comaparative analysis if not possible in expression