Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
CostinelRO
Contributor II
Contributor II

SET ANALYSIS with 3 conditions

Hello, I am trying the represent data in a barchart like this, If the user does not select any date, show the yesterday data.

If he selects a date or a range of dates show the data in that specific range.

I am using the following the setanalysis:

=IF(GetSelectedCount(DateAll)>0, AVG({<delta= {">-25<8"},[table2.mach_group]={"BCA"}>} delta),

AVG({$<DateAll={'$(YESTERDAY)'},delta= {">-25<8"},[table2.mach_group]={"BCA"}>} delta))

 

I am using the same logic for other representation and it works(but with only 2 set analysis). Can someone tell me if I am integrating the 3 conditions correct in the formula?

I tested the date format using the bellow formula and it works. So the date fromat should be correct 

=IF(GetSelectedCount(DateAll)>0, 1, 2) 

Labels (1)
2 Replies
Anil_Babu_Samineni

You can perform 3rd condition like

=IF(GetSelectedCount(DateAll)>0, AVG({<delta= {">-25<8"},[table2.mach_group]={"BCA"}>} delta),

If(GetSelectedCount(DateAll)>0, <Your third condition>, AVG({$<DateAll={'$(YESTERDAY)'},delta= {">-25<8"},[table2.mach_group]={"BCA"}>} delta)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jyothish8807
Master II
Master II

Hi CostinelRO,

May be the issue is with your $(YESTERDAY) variable. Try this once

Define variable like this:

YESTERDAY = date(max({1} DateAll)-1,'Yourdateformat') //make sure to add a "=" in the variable definition, also i believe you have data available for the yesterday 🙂 

Best Regards,
KC