Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis - Month data

Hello, guys,

I am new to QlikView and appreciate any help. I have got a problem with a kind of set analysis. My data is the following:

Date,

Car,

KilometersInTown,

KilometersOutOfTown,

KilometersHighway,

Driver,

StartingKilometers,

EndKilometers,

TotalKilomertersForItinerary

I need to calculate filtered data by month. The formula for StartingKilometers is:

=sum(StaringKmofCar) +

RangeSum(Above(total Sum(KmCity) , 1, 100))  +
RangeSum(Above(total Sum(KmHwy) , 1, 100)) +
RangeSum(Above(total Sum(KmOutofCity) , 1, 100))

StartingKmofCar is a field taken from the database.

Here is an example. The date is for the previous month of analyzing period.

DateCarKilometersInTownKilometersOutOfTownKilometersHighwayDriverStartingKilometersEndKilometersTotalKilomers
30.06.2017Volvo10125John1000102727
30.06.2017Volvo0080John1027110780

I would like to take the end km of last period as starting km for the analysing period (in example - July 2017). Analysing period data:

DateCarKilometersInTownKilometersOutOfTownKilometersHighwayDriverStartingKilometersEndKilometersTotalKilomers
01.07.2017Volvo123John110711136
02.07.2017Volvo456John1113112815

I think that a possible solution is to save in aggregated dynamically table the EndKilometers and then to take the value as a StartingKilometers for the analyzing period. But I cannot find the right way to do this. What do you think? Is there any other possible solution?

Thanks,

Todor Vasilev

2 Replies
tomovangel
Partner - Specialist
Partner - Specialist

Hello, Could you provide sample data?

Maybe if you use a set expression stored into a variable vStartKM, it would be easier?

-Angel

Anonymous
Not applicable
Author

Thanks Angel.

I have done it in other way.