Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
try max(year_quarter) under document settings/actions
therefore try to combine both fields to year&quarter as year_quarter
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
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.
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,
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
Regards, Daniel
If you want, this function can be create with MACRO
Thanks but I am not familiar with Macro's.
If you can give some idea, will try to implement the same.
Thanks,
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.
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,