Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

Bar chart Trend help

Hi,

Can any one please help me on below requirement

I have a Dashboard default view like below

Default view.png

By selecting [Comparison Date] =11/10/2019 getting below bar chart with 8 as count

11102019.png

 

By selecting [Comparison Date] =15/10/2019 getting below bar chart with 7 as count

15102019.png

But user wants to see all comparison dates 11/10/2019 AND 15/10/2019 Two bars at a time without selecting any thing from Comparison date as default trend.

Please help me on this.

Please find the below attached application and Excel source file.

Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

Set analysis won't work anymore, try these expressions

Added

=Sum(Aggr(If(Count(ID) = 1 and Count(DISTINCT {<[Report Date]>} If([Report Date] = [Comparision Date], ID)) = 0, 1, 0), [Comparision Date], ID))

Removed

=Sum({<[Report Date]>} Aggr(If(Count(ID) = 0 and Count(DISTINCT {<[Report Date]>} If([Report Date] = [Comparision Date], ID)) = 1, 1, 0), [Comparision Date], ID))

Renamed

=Sum(Aggr(
	If(Count(ID) = 1 and
       Count(DISTINCT {<[Report Date]>} If([Report Date] = [Comparision Date], ID)) = 1 and
       Only(Name) <> Only({<[Report Date]>} If([Report Date] = [Comparision Date], Name))
    , 1, 0)
, [Comparision Date], ID))

View solution in original post

4 Replies
mahitham
Creator II
Creator II
Author

Hi @sunny_talwar 

Could you please help me on this requirement.

In this scenario is there any way to show the Trend without selecting any comparison date.

Thanks in advance.

sunny_talwar

Set analysis won't work anymore, try these expressions

Added

=Sum(Aggr(If(Count(ID) = 1 and Count(DISTINCT {<[Report Date]>} If([Report Date] = [Comparision Date], ID)) = 0, 1, 0), [Comparision Date], ID))

Removed

=Sum({<[Report Date]>} Aggr(If(Count(ID) = 0 and Count(DISTINCT {<[Report Date]>} If([Report Date] = [Comparision Date], ID)) = 1, 1, 0), [Comparision Date], ID))

Renamed

=Sum(Aggr(
	If(Count(ID) = 1 and
       Count(DISTINCT {<[Report Date]>} If([Report Date] = [Comparision Date], ID)) = 1 and
       Only(Name) <> Only({<[Report Date]>} If([Report Date] = [Comparision Date], Name))
    , 1, 0)
, [Comparision Date], ID))
mahitham
Creator II
Creator II
Author

Thanks a lot Bro.... Its working @sunny_talwar 

mahitham
Creator II
Creator II
Author

Hi @sunny_talwar 

Hope you are doing well.

Few days back you have provided the solution for this bar chart.

This is working fine with sample data when I have loaded original data then its giving "Calculation timeout error" because of aggr().
So I have tried the below backend script which is in below link.
https://community.qlik.com/t5/QlikView-App-Development/Script/m-p/1648882#M447700

This script also working fine in sample data but in original data "Added" count is not getting correctly in the Trend. Could you please check the below script once. Please help me am I missed any thing.
Thanks in advance.