Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Current quarter in bar chart

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.

6 Replies
MVP
MVP

Re: Current quarter in bar chart

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

Not applicable

Re: Current quarter in bar chart

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!

MVP
MVP

Re: Current quarter in bar chart

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

Highlighted
MVP
MVP

Re: Current quarter in bar chart

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

Re: Current quarter in bar chart

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.

MVP
MVP

Re: Current quarter in bar chart

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.

Community Browser