Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Bala_s
Contributor III
Contributor III

Condition to show hide based on sequential Month selection

Hi Experts,

I'm facing difficulty to get a solution for my below requirement, Request your expertise here.

Thanks in advance.

Scenario: I have Monthly sales in a bar chart, if the user selects nonsequential order of month then my chart should show an error message.  

Ex--> User may select--> Jan, Mar, Nov etc

if user selects sequential order of month then my chart should display the numbers.

Ex--> User may select--> Sep, Oct, Nov

 

Thanks

Labels (2)
1 Solution

Accepted Solutions
marcus_sommer

You may use a condition like:

= (max(Month) - min(Month) + 1) = count(distinct Month)

Of course Month needs to be numeric. If year-swaps should be included you would need to apply the logic on a continuous MonthCounter.

Beside this it might be more user-friendly not to show errors else to show always a continuous row of months - maybe with a set analysis like:

sum({< Month = {">=$(=min(Month))<=$(=max(Month))"}>} Value)

View solution in original post

6 Replies
Bala_s
Contributor III
Contributor III
Author

Hi @tresesco , @swuehl , @marcus_sommer 

Any inputs from you pls?

 

Thanks

 

marcus_sommer

You may use a condition like:

= (max(Month) - min(Month) + 1) = count(distinct Month)

Of course Month needs to be numeric. If year-swaps should be included you would need to apply the logic on a continuous MonthCounter.

Beside this it might be more user-friendly not to show errors else to show always a continuous row of months - maybe with a set analysis like:

sum({< Month = {">=$(=min(Month))<=$(=max(Month))"}>} Value)

jmartineze
Partner - Creator
Partner - Creator

hi,

in data handling, calculation condition, you can use

num(min(month))+GetSelectedCount(month)-1=num(max(month))

Bala_s
Contributor III
Contributor III
Author

Thanks a lot  @marcus_sommer  & @jmartineze 

rajeshwar1
Partner - Contributor III
Partner - Contributor III

Hi Marcus,

 

Can you tell what will be the expression if Month-Years are there?

marcus_sommer

It's in general the same. Important is that the fields are numeric. You may use any kinds of strings or formatted values within the dimensions or selections but if you want to match or calculate with them it should be pure numbers. For MonthYear these fields might be created with:

year(Date) * 100 + month(Date)

and/or

year(Date) * 12 + month(Date)