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: 
trevorkr
Contributor
Contributor

how to calculate result difference from average previous 4 week same weekday results

Hello

I am trying to create a KPI that would show me the difference of filtered dates' result against the selected dates same weekdays results, looking back only 4 weeks (29 days) from filtered date.

For example, if I were to select 09.08.2018 from filter then the KPI would show me the percentage of how much different the selected dates result is compared to last 4 weeks same weekdays average result.

I tried to create an expression but it is not limiting the selection to 4 weeks.

=

(

Sum(

{

    $

    <

    TYPE={'10'},

    CurYTDFlag={1},

    PPR_TYPEID={'1','2','3'}

    >

    }

    RESULT

    ))

/

(Only(

Aggr( 

Sum

    (

    Total

    <

    WeekDay

   

    >

    RESULT)

    /

    count(

    Total

    <

    WeekDay

   

    >

    DISTINCT DB_KPI_DATE),

    WeekDay,

    DB_KPI_DATE)))

    -1

Can any one please help

1 Reply
sunny_talwar

Are you doing this in a text box object? Also, it would be easier to make sense of this if you can share a sample app to look at...