Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get previous week metric data in another metri

Hi Team,

Good day

since last few days i am trying to achieve below mentioned issue in my dashboard

issue:

1.i need to display the previous metric data in another metric

2.again i need to subtract the current week data with previous metric data

EX:

in my issue   i have date,previous week and current week fields

so now along with date i need to display previos and current week date

like below ;

Main table from Database:

    Date                              current                   

   5-march-2017                  5                          

   12-march-2017                8                         

   19-march-2017               10                       

   26-march-2017                15 

Note:

Date columns contain only week data 

          

out put table i need to show in dashboard:

      Date                        current      previous                                               difference(currentweek-previousweek) metric 

  12-march-2017                 8                5(this value is 5-march-current week data)          3

   19-march-2017              10                 8                                                                     2

   26-march-2017              15                10                                                                    5

could you please suggest me how can i achive solution for this?

i have attached the QVW as well for same

7 Replies
Anil_Babu_Samineni

How you are calculating the current week. Where you want to exclude the 5th of the date. What was the logic behind and reason should be there

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

Hi anil,

please look on attached QVW file in earlier link  then you can easily understand the logic of current and prev metric values in qlk .it just sum anb set analysis

ahaahaaha
Partner - Master
Partner - Master

Hi,

May be like this if I right understand you (in attached file the table with red header background).

Regards,

Andrey

ahaahaaha
Partner - Master
Partner - Master

I'm not sure that I correctly understood how many lines to output and how the date is determined in the top line.

Anil_Babu_Samineni

It will work, Can i know the reason why you want to remove 5-march date. Because, by clue that we came to know the logic behind.

Note: I have seen and make sense too

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
tsagarrao
Contributor
Contributor

Current Week=sum(Sales)

Previous week =Aggr(above((sum(Sales),date)

Trend:

Difference=sum(Sales)-Aggr(above(sum(Sales)),date)

You can restrict the date / data using variable or Aggr function in Demension level (Date) for last 4 dates , last 5 dates

Anonymous
Not applicable
Author

maybe this solution could be ok for you