Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Default selections

Hi,

I have two fields Year and Quarter with the values of 2005, 2004, 2005, 2006, 2007

And Quarter is 01, 02, 03, 04

default selection should be 2007 and 04

Later If I add 2008 in Year field it should select 2008 and 04.

Any settings in properties.

Thanks,

17 Replies
Not applicable
Author

try max(year_quarter) under document settings/actions

therefore try to combine both fields to year&quarter as year_quarter

raghavsurya
Partner - Specialist
Partner - Specialist

Hi Tims,

Please use below query. I have assumed cost as the field for which u want to get the sum.

Sum({< Year={$(=Max(Year))}, Quarter={$(=Max(Quarter))}>}(Cost))

Regards,

Raghav

Not applicable
Author

Hi,

I Think that fields YEAR and QUARTER are a derivation of a just field;

Load

your_date,

YEAR(your_date) as YEAR,

NUM(MONTH(your_date)) / 3 AS QUARTER

FROM your_table;

You just need to set this field (your date), with the max value using the function "MAX()"

In Document Properties, Tab Triggers, select in "Document Event Triggers" option "OnOpen" and add a action. Action Type: "Selection" and "Select in Field"

insert the name of FIELD that you want (your_date) and in "Search String" put "=MAX(your_date)".

When your document is open, the max date will be select, and the MAX YEAR and MAX QUARTER too.

Not applicable
Author

Hi Daniel,

I am using 8.2 version, so I did not see this option.

am I right the option not available in 8.2?

Thanks,

Not applicable
Author

Hi Tim,

you are right, this function is only available since version 9.0.

Maybe you could build a workaround with variables and macros to simulate qlikview's internal actions.

However, I would recommend to update to v9 or v10, because additional functions are worth this one time effort and will save a lot of programming work Wink

Regards, Daniel

Not applicable
Author

If you want, this function can be create with MACRO

Not applicable
Author

Thanks but I am not familiar with Macro's.

If you can give some idea, will try to implement the same.

Thanks,

Not applicable
Author

Hi,

Press CTRL + M in your Document and open "Edit Module".

Paste the code and will be create a macro function to select the max value in your especific field:

SUB SELECT_MAX_DATE

ActiveDocument.Fields("YOUR_FIELD").Select ActiveDocument.Evaluate("max(YOUR_FIELD)")

END SUB

Press button Check and OK to create the function.

After create function go to Document Properties and tab MACRO. In Document event select a "On Open" and select your function "SELECT_MAX_DATE".

PRESS OK and save document.

When document open the max date will be select.

Not applicable
Author

Thanks Correa,

Its working fine, but suppose if my dashboard have two tabs and each tab is using different xls files.

Then Do we have any options to define for two fields?

Thanks,