Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current quarter in bar chart


Hi All,

I am using below expression for calcution in bar chart. But I want to show only current quarter. Please suggest how to achieve the same.

Expression:

 

Count

({$<Account_Table_Pulse.Responded={'Yes'},Account_Table_Pulse.Q2_Score={6,7},Quarter={$(=only(Quarter))}>}Account_Table_Pulse.Responded)/Count({$<Account_Table_Pulse.Responded={'Yes'},Quarter={$(=only(Quarter))>}Account_Table_Pulse.Responded)

No data message is displaying with above expression, where dimension is Quarter.

Any help will be appreciated!

Thanks,

Ankita

1 Solution

Accepted Solutions
Not applicable
Author

I got solution

I have taken value as Quarter={'Q1'} and so on on 3 charts and exculded Month and Day selection.


Now could you help me reflect always current year and quarter selection in the calendar.

Note : I am using .qvc component calendar.

View solution in original post

6 Replies
tresesco
MVP
MVP

If you mean current selecetion is your current quarter, then remove the " Quarter={$(=only(Quarter)) " from the set and try.

Not applicable
Author

Thanks for reply!

In my application I hv default selection of current year and quarter.
Secondly, I have to prepare 3 bar charts with same above mentioned expression. In these charts 1 will show current year and quarter, 2nd will show current year and previous quarter, 3rd will show current year and previous of previous quarter.

Thanks!

tresesco
MVP
MVP

Please share your sample app so that the data format can be understood and solved faster. Otherwise, this loop of questioning would be longer.

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you have Date Dimension in your datamodel then use like this

Current Quarter:

=Sum({<Year=, Month=, Quarter=, DateDimension={'>=$(=QuarterStart(Today()))<=$(=Today())'}>} Sales)

Previous Quarter:

=Sum({<Year=, Month=, Quarter=, DateDimension={'>=$(=QuarterStart(Today(), -1))<=$(=QuarterEnd(Today(), -1))'}>} Sales)

2nd Previous Quarter:

Previous Quarter:

=Sum({<Year=, Month=, Quarter=, DateDimension={'>=$(=QuarterStart(Today(), -2))<=$(=QuarterEnd(Today(), -2))'}>} Sales)

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

I got solution

I have taken value as Quarter={'Q1'} and so on on 3 charts and exculded Month and Day selection.


Now could you help me reflect always current year and quarter selection in the calendar.

Note : I am using .qvc component calendar.

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you want to change the quarters based on the current period, then you have use the dynamic expressions like this, your expressions are hard coded, so the quarters won't change dynamically.

If you have Date Dimension in your datamodel then use like this

Current Quarter:

=Sum({<Year=, Month=, Quarter=, DateDimension={'>=$(=QuarterStart(Today()))<=$(=Today())'}>} Sales)

Previous Quarter:

=Sum({<Year=, Month=, Quarter=, DateDimension={'>=$(=QuarterStart(Today(), -1))<=$(=QuarterEnd(Today(), -1))'}>} Sales)

2nd Previous Quarter:

Previous Quarter:

=Sum({<Year=, Month=, Quarter=, DateDimension={'>=$(=QuarterStart(Today(), -2))<=$(=QuarterEnd(Today(), -2))'}>} Sales)

Hope this helps you.

Regards,

Jagan.