Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

like for like calculation

Hello

I got a qlikview document that has the following tables:

Daily Sales

Business Units

Calendar

The Calendar has a field called [Transaction Date] linked to the Daily Sales

and the Daily Sales has a field [BU Code] that links it to the table Business Units

Each business unit has an [Open Date] that determines when the businees unit was open

Now the user selects the Year 2012 and Week 14 from the Calendar

Now I want to calculate the Like for Like sales

I was given the following requirement for this calculation

the calculation is applied for business units that have open date less than the last day of the week of previous year and the closing date is either null or greater than the first date of the week of the previous year

but for these business units I need to take into consideration the transactions that took place after one year of the opening date

I've written the following expression:

when I include the commented line instead, I get nothing

Please advise

sum

          (

                    {

                    <

                                        H_Flag={'Sales'},

                                        [Open Date]={"<=$(max(

                                                                                          {<

                                                                                                    [AZ Year]={$(=max([AZ Year])-1)},

                                                                                                    [AZ Week]={$(=max([AZ Week]))}

                                                                                          >}

                                                                                          [H_Transaction Date] ))"},

  //[Transaction Date] = {">= $(=min(AddYears([Open Date],1)))"},

                                        [Transaction Date] = {">= $(=min([Open Date]))"},

                                        CloseDateLFL={">=$(min(

                                                                                          {<

                                                                                                    [AZ Year]={$(=max([AZ Year])-1)},

                                                                                                    [AZ Week]={$(=max([AZ Week]))}

                                                                                          >}

                                                                                          [H_Transaction Date] ))"}

                              >

                    }

                    [Sales Amount USD]

          )

I can walk on water when it freezes
1 Reply
vgutkovsky
Master II
Master II

Ali, please don't double-post the same question...it makes it hard for Community users to find relevant answers. I've added a response to your other post.

Regards,

Vlad