Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dunnalahk123
Creator III
Creator III

Open sheet should select always latest 5 Quarters ?

Hi,

When i Open a sheet always latest 5 Quarters should be selected in my Qlikview Report , how can we do it?

my Quarter field is FY_QYM

in that values is as per below

Quarter.PNG

Best Regards,

14 Replies
MK9885
Master II
Master II

Not sure how you can achieve triggers but to get 5 Quarts combine try...

In back end

if(InQuarter(TempDate, today(),-1), 1, 0) as LastQtrFlag,

if(InQuarter(TempDate, today(),-2), 1, 0) as LastQtrFlag1,

if(InQuarter(TempDate, today(),-3), 1, 0) as LastQtrFlag2,

if(InQuarter(TempDate, today(),-4), 1, 0) as LastQtrFlag3,

if(InQuarter(TempDate, today(),-5), 1, 0) as LastQtrFlag4,

And in front end

if(GetSelectedCount(Year)=0,

aggr(Only({ < LastQtrFlag={1} >+<  LastQtrFlag1={1}>+<LastQtrFlag2={1}>+<LastQtrFlag3={1} >+< LastQtrFlag4={1}  >}  [Quarter Year]) ,[Quarter Year]), [Quarter Year])

This would give you by default always last 5 quarters with no selections but not sure how to set this inside a trigger.


Maybe someone else has better answer or can create a flag from this etc...

passionate
Specialist
Specialist

Hi,

PFA, Solution.

Regards,

Pankaj

prieper
Master II
Master II

Dear,

a sample would have been enough - not the entire database ....

Anyhow:

Your row 65 does not make much sense, but you may rewrite it to

DUAL(FY_QM, RIGHT(FY_QM, 2) * 100 + MID(FY_QM, 2, 1) AS FY_QM_new

This would also convert the string into a (senseless, but) numeric expression, which then might be filtered.

For the on-open-event please then create a trigger

='=Rank(FY_QM_New)<=5'

HTH
Peter

dunnalahk
Contributor III
Contributor III

Hi,

Thank you .

i wrote like below in script

AutoNumber(FYear & FY_QM, 'QuarterID') as [QuarterID]

and open sheet i have given as below in triggers

'=Rank(QuarterID)<=5'

It works. 🙂

prieper
Master II
Master II

Hi,

you need to be careful, as AUTONUMBER will read the values in the order of entry of the , i.e. if 2018 will be loaded before 2017, it will get a lower number as if it would be loaded in the numeric sequence.

Give it a try with

Data:

    LOAD *,

        AUTONUMBER(Year & Quarter)        AS id

    INLINE

        [Year, Quarter, Value

        2018, Q118, 2

        2018, Q218, 4

        2017, Q118, 5];

and watch the outcome ...