Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
Chanty4u
Esteemed Contributor III

year quarter

Hi guys,

i have year and yearquarter field

one pie chart one bar chart with sum(sales)

so my requiremment is wenever i clear all it wil display the max year higest quarter value for that what can i do

can anyone give me the suggestions.

my fileds

year     yearquarter

                                            

2000     2000Q1,2000Q2,2000Q3,2000Q4

2001     2001Q1,2001Q2,2001Q3,2001Q4

2002     2002Q1,2002Q2,2002Q3,2002Q4

2003     2003Q1,2003Q2,2003Q3,2003Q4

result wil be lik

display 2003Q4 sales.

Thank you

Suresh

1 Solution

Accepted Solutions

Re: year quarter

Pie chart like this? (PFA)

Capture.PNG

View solution in original post

10 Replies

Re: year quarter

You can probably use an if statement.

If(GetSelectedCount(Selection) = 0, Sum({<yearquarter = {'2000Q1'}>} Sales), Sum(Sales))

HTH

Best,

Sunny

sasiparupudi1
Honored Contributor III

Re: year quarter

Please post your qvw

MVP
MVP

Re: year quarter

=IF(IsNull(GetCurrentSelections()),SUM({<yearquarter = {"$(=MaxString({<year = {$(=Max(year))}>}yearquarter))"}>}sales), sum(sales))

Re: year quarter

Hi Suri,

When none of the selection are made and if you want the highest year and Quarter to be displayed then you can follow  sunindia‌ suggestion . If you want the selection to be set for highest only on the clear selection event then its not possible

Partner
Partner

Re: year quarter

goto your sheet properties (the sheet which contains your Charts) and define the trigger

select field yearquarter with =maxstring({1}yearquarter)

define the macro

sub DefineClearState
ActiveDocument.SetClearState
end Sub

at last Action in sheet Trigger define

run macro DefineClearState

whenever you press the clear button it will select the latest yearquarter

Chanty4u
Esteemed Contributor III

Re: year quarter

Hi

thank you for ua response.

Plase find the attached qvw.

wit in dat i want to display wenever i clear all the values display the max year curren quarter value

Thank you

Suresh

Re: year quarter

You data is somewhat different, but the attached qvw seems to work.

Capture.PNG

Chanty4u
Esteemed Contributor III

Re: year quarter

hi sunindia,

thanks it works fine .

bt wen i clear all  in text box it is showng later year quarter. but  in chart i want to display sum (sales)

and in  i want one pie chart in same page  disply sum(sales) per year

Re: year quarter

Pie chart like this? (PFA)

Capture.PNG

View solution in original post