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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

How to write a set analysis

Hello all,

I need to show year start  month to selected month sales .

if apr-17 is selected then jan 17 to apr-17 sales need to be shown in bar chart

Capture.PNG

How to write this in set analysis...

Thanks

1 Solution

Accepted Solutions
juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

You also need to ignore your other filters, because your expression is now filtered by the Floor_Month_year field:

sum({<Floor_Month_year={">=$(=floor(YearStart(Max(Floor_Month_year))))<=$(=floor(Max(Floor_Month_year)))"}, Year, Month, YearMonth, Datenum>}Sales)

View solution in original post

11 Replies
andrey_krylov
Specialist
Specialist

Hi, try this

{< Month_Year, Date = {"$(='>=' & YearStart(Max(Date)) & '<=' & Date(Max(Date)))"} >}

kunkumnaveen
Specialist
Specialist
Author

If only a year 2017 is selected then  jan to dec Months are showing  as below

sum({<Floor_Month_year={">=$(=floor(YearStart(Max(Floor_Month_year))))<=$(=floor(Max(Floor_Month_year)))"}>}Sales)

Capture.PNG

But when i selected any month (Apr-17) instead of showing Jan-17 to Apr-17 i getting below screen

Capture.PNG

I think i need to change some where in my expression

sum({<Floor_Month_year={">=$(=floor(YearStart(Max(Floor_Month_year))))<=$(=floor(Max(Floor_Month_year)))"}>}Sales)

Any help regarding this

kunkumnaveen
Specialist
Specialist
Author

Any help on this issue plz

andrey_krylov
Specialist
Specialist

The better way is to create a textbox and see what these expressions give you

=floor(YearStart(Max(Floor_Month_year)))

=floor(Max(Floor_Month_year))

and  what you have in Floor_Month_year

kunkumnaveen
Specialist
Specialist
Author

Hello,i did check that

both the expression are giving the correct values individually  but when i combined them in a set analysis i am not getting the required output .

Did u see any issue in my expression .

sum({<Floor_Month_year={">=$(=floor(YearStart(Max(Floor_Month_year))))<=$(=floor(Max(Floor_Month_year)))"}>}Sales)


before any month selection it is working fine ,the issue is when i select any month

andrey_krylov
Specialist
Specialist

Can you post these values?

kunkumnaveen
Specialist
Specialist
Author

When only Year(2017) is selected

Capture.PNG

when Year(2017) and Month(Apr) is selected

Capture.PNG

juraj_misina
Partner Ambassador Affiliate
Partner Ambassador Affiliate

You also need to ignore your other filters, because your expression is now filtered by the Floor_Month_year field:

sum({<Floor_Month_year={">=$(=floor(YearStart(Max(Floor_Month_year))))<=$(=floor(Max(Floor_Month_year)))"}, Year, Month, YearMonth, Datenum>}Sales)

andrey_krylov
Specialist
Specialist

Hi, Juraj. You're right, I just can't figure out how the april selection gives january in the chart