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: 
Amit_B
Creator
Creator

Line Chart display issue with condition

Hi,

I have a line char with 2 dimension - Year-Month & Category.
It possible to add only one measure which include if statement.

let's consider 2 simple scenarios to display average amount per order:
* If user selection include several months (count(distinct Year-Month) <> 1) then display the measure for the selected range.
* If user selection include only one month (count(distinct Year-Month) = 1), then display the same measure for a specific date range based on this month.

So, the full measure is:
If(Count(distinct Year-Month) <> 1,
   Sum(Amount) / Count(distinct OrderID),
   {<Date={">=$(vMinDate)<=$(vMaxDate)"}, Year=, Month=>} Sum(Amount) / Count(distinct OrderID)
)

Every part work good separately, but doesn't work with the condition.
For example, on the x-axis, I need to see only the relevant months.

Amit_B_0-1721749461247.png

Thanks,
Amit.

*Edit*
When Count(distinct Year-Month) = 1, I see only the selected month data and not a range of months (set in the variables).

 

Labels (4)
2 Replies
MatheusC
Specialist
Specialist

@Amit_B 
And unchecking the checkbox in Data Handling of zero values?

MatheusC_0-1721754697112.png



- Matheus

 

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
Amit_B
Creator
Creator
Author

Yes, I tried it.