Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
sunainapawar
Creator
Creator

If else logic with set analysis in qliksense

Hello All,

Need assistance in small logic in Qliksense.

I need to calculate sum(allocation) for current Quarter by below logic,

When the Month is First month of Quarter, it Should Calculate Sum(amount) as it is

When the Month is Second Month of Quarter,it should calculate Sum(amount) of FIrst Month+Second Month and divide by 2.

When the Month is Third Month of Quarter, it should calculate Sum(amount) of First+Second+Third Month and divide by 3.

I applied logic as below but the logic works only when the month is selected. But i dont need month to be selected i.e.,without Month selection also it must show the sum(amount)

if(MonthYear=MonthName(QuarterStart(today())),


Sum({<QuarterYear_S={'$(VCurrentQtr)'},MonthYear={'$(=MonthName(QuarterStart(today())))'}>}amount),

if(MonthYear=MonthName(QuarterStart(today()),1),


(Sum({$<QuarterYear_S={'$(VCurrentQtr)'},MonthYear{'$(=MonthName(QuarterStart(today())))','$(=MonthName(QuarterStart(today()),1))'}>}
amount)/2),

if(MonthYear=MonthName(QuarterStart(today()),2),


(Sum({$<QuarterYear_S={'$(VCurrentQtr)'},MonthYear={'$(=MonthName(QuarterStart(today())))','$(=MonthName(QuarterStart(today()),1))','$(=MonthName(QuarterStart(today()),2))'}>}
amount)/3)
)))

Kindly assist. Thanks in advance.

 

Labels (1)
2 Replies
sunainapawar
Creator
Creator
Author

Hi,

Kindly help.

Thanks in advance.

PradeepK
Creator II
Creator II

Avoid doing it in expression. Create simple As-Of-Table