Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

take over main calendar and overrule with set analyses -- help needed!

I'm trying to overrule the main calendar end taking over the selection to another calendar using set analysis.

This is what I came up with ...

count({<

  Calls.StartDate_Year ={$(=if(GetSelectedCount(Year)>0,GetFieldSelections(Year)))},

  Calls.StartDate_Month ={$(=if(GetSelectedCount(Month)>0,GetFieldSelections(Month)))},

  Calls.StartDate_Week ={$(=if(GetSelectedCount(Week)>0,GetFieldSelections(Week) ))},

  Calls.StartDate_Day ={$(=if(GetSelectedCount(Day)>0,GetFieldSelections(Day)))},

  Year=,Month=,Week=,Day=>}

  Callnr

  )

The only problem with this script is that if one of the used fields Year/Month/Week/Day is not selected this is not working.

I need something to resolve the GetSelectedCount(xxx) = 0 ...

anyone got ideas to solve this??

1 Solution

Accepted Solutions
sunny_talwar

What about this:

Count({<

  Calls.StartDate_Year ={$(=if(GetSelectedCount(Year)>0,GetFieldSelections(Year), '*'))},

  Calls.StartDate_Month ={$(=if(GetSelectedCount(Month)>0,GetFieldSelections(Month), '*'))},

  Calls.StartDate_Week ={$(=if(GetSelectedCount(Week)>0,GetFieldSelections(Week), '*'))},

  Calls.StartDate_Day ={$(=if(GetSelectedCount(Day)>0,GetFieldSelections(Day), '*'))},

  Year=,Month=,Week=,Day=>} Callnr)

View solution in original post

6 Replies
sunny_talwar

What if you use Concat function instead of GetFieldSelections?

Count({<

  Calls.StartDate_Year ={$(=Concat(Year, ','))},

  Calls.StartDate_Month ={$(=Concat(Month, ','))},

  Calls.StartDate_Week ={$(=Concat(Week, ','))},

  Calls.StartDate_Day ={$(Concat(Day, ','))},

  Year=,Month=,Week=,Day=>}

  Callnr

  )

MK_QSL
MVP
MVP

Replace as below

$(=if(GetSelectedCount(Year)>0,GetFieldSelections(Year),Max(Year)))

and so on.

Anonymous
Not applicable
Author

in this case the max(year) will give a year selections ... but what i need for 'no field selected' in Year:

{< Calls.StartDate_Year =  >}

and when year is selected I need

{< Calls.StartDate_Year = {$(GetFieldSelections(Year))}, Year= >}



To prevent a lot of coding I want to get it in set analysis ... Else I have to write for every possible selection combination a lot of code ...

Anonymous
Not applicable
Author

this doesn't seem to do the trick

sunny_talwar

What about this:

Count({<

  Calls.StartDate_Year ={$(=if(GetSelectedCount(Year)>0,GetFieldSelections(Year), '*'))},

  Calls.StartDate_Month ={$(=if(GetSelectedCount(Month)>0,GetFieldSelections(Month), '*'))},

  Calls.StartDate_Week ={$(=if(GetSelectedCount(Week)>0,GetFieldSelections(Week), '*'))},

  Calls.StartDate_Day ={$(=if(GetSelectedCount(Day)>0,GetFieldSelections(Day), '*'))},

  Year=,Month=,Week=,Day=>} Callnr)

Anonymous
Not applicable
Author

If doing the same with fields containing strings ... what's the best way?? using the getfieldselections? of using concat?