Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dynamically should be changed max year with quarter

Hi All,

In My Bar chart

My Dimension is

=Pick(Measure ,if(YEAR='$(=max({<NAME={A,B,C,D},QUARTER={'Q4'}>}YEAR))',

YEAR&'-'&QUARTER,

if(YEAR and QUARTER='$(=maxstring({<YEAR={$(=max(YEAR))}>}QUARTER))',YEAR))

,if(YEAR= '$(=max({<NAME={A,B,C,D}>}YEAR))'

and QUARTER='$(=maxstring({<YEAR={$(=max(YEAR))}>}QUARTER))', YEAR

))

Expressions are

=(Avg({<NAME={A},QUARTER={'Q4'}>}VALUE))

=(Avg({<NAME={B},QUARTER={'Q4'}>}VALUE))

=(Avg({<NAME={C},QUARTER={'Q4'}>}VALUE))

=(Avg({<NAME={D},QUARTER={'Q4'}>}VALUE))

Presently we are showing for the max year with quarter in the chart as dimension and we are restricting with quarter-Q4. But we have data for the latest year 2015 Q1,Q2 and we required to show fo only latest year as 2015 Q2 in the chart and previous years should be calculated only Q4 and shoudl be shown as 2012,2013,2014,2015-Q2.

The above process should be done dynamically.

Please help me on this jaganMRKachhiaIMP

Labels (1)
11 Replies
Kushal_Chawda

Would you be able to share the Sample?

For now try like below

Dimension:

YEAR

QUARTER

Expression

1) avg({<NAME={'A'},YEAR={"$(=max(YEAR))"}, QUARTER={"$(=maxstring({<YEAR={$(=max(YEAR))}>}QUARTER))"}>}Value)

2) avg({<NAME={'B'},YEAR={"$(=max(YEAR))"}, QUARTER={"$(=maxstring({<YEAR={$(=max(YEAR))}>}QUARTER))"}>}Value)


Not applicable
Author

Hi Kush,

Many thanks for your reply.

But for the previous years 2014,2013 and soon i want to calculated only Quarter = Q4. For latest and max year  i want to show which quarter is max. presently we have data for 2015 Q1 and Q2. now i want to show as 2015-Q2

Not applicable
Author

Hi All

Please help me on this

Kushal_Chawda

when you will select the Year from list box it will automatically pick the latest quarter for that selected year

Not applicable
Author

hi All,

here in bar chart dimension is calculated dimension - =if(YEAR=YEAR(Today()),YEAR&'-'&'QUARTER',if(DATE>='12/31/1916',YEAR))

My six expressions are =if(YEAR=YEAR(Today()),Avg({<NAME={'A'}>}VALUE),Avg({<NAME={'A'},QUARTER={'Q4'}>}VALUE)) and other expression are NAME= B,C,D,E

now i want to calculate latest QUARTER in the above epression.

Please let me know on this how to calculates latest quarter

Thanks

Avinash

Not applicable
Author

hi All

please help me on this

koushik_btech20
Creator
Creator

Hi Avinash,

You don't need to write or use calculated dimension, what you can want just wrote under set expression.

Just take YEAR as dimension and for max year and max quarter then expression will be like,


=Avg({<NAME={'A'},YEAR={'$(=MAX(YEAR))'},Quarter={'$(=Maxstring(Quarter))'}>}VALUE)

Not applicable
Author

thank for your reply.

here i have data till 2015-Q2 only.

now my requirement in the x-axis year i want to display like this 2015-Q2,2014,2013,2012,2011 and soon

for 2014,2013,2012 and soon for these years the max quarter to be taken i.e Q4 valaves only should be taken for these years.

but for the 2015 year we have Q1 and Q2 so 2015-Q2 only shoul be display.

here we have two requirements

please let me know on this

koushik_btech20
Creator
Creator

Hi Avinash,

So you need to show inside the dimension it will  show, 2015-Q2,2014-Q4,2013-Q4,2012-Q4 and so .....

I thing you can do these things inside the script so it will be more easy for handling.

Regards,

Koushik