Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
maschi77
Contributor II
Contributor II

last 3 Month

I would like to analyze the service level of the delivery capability from a table. Unfortunately, I can't get the correct result with this formula (list attached)

=if(ShippingDateConfirmed <> '01.01.2016',sum{<CreatedDateTimeMonth={">=$(=max(CreatedDateTimeMonth)-2)<=$(=Max(CreatedDateTimeMonth))"}>}If([ShippingDateRequested] >= [ShippingDateConfirmed],1,0)))

/
count({<CreatedDateTimeMonth={">=$(=max(CreatedDateTimeMonth)-2)<=$(=Max(CreatedDateTimeMonth))"}>}OrderId)

        Servicelevel Total 58,6%
        Servicelevel 6 Mo 72,9%
        Servicelevel 3 Mo 84,4%
OrderId Created Date CreatedDateTimeMonth ShippingDateRequested ShippingDateConfirmed  Service 
AUF255385 25.10.2024 Okt. 30.10.2024 30.10.2024                          1,00
AUF255311 22.10.2024 Okt. 24.10.2024 24.10.2024                          1,00
AUF255260 18.10.2024 Okt. 31.10.2024 31.10.2024                          1,00
AUF255104 09.10.2024 Okt. 11.10.2024 11.10.2024                          1,00
AUF255087 09.10.2024 Okt. 31.10.2024 31.10.2024                          1,00
AUF255093 08.10.2024 Okt. 08.10.2024 08.10.2024                          1,00
AUF255099 08.10.2024 Okt. 10.10.2024 10.10.2024                          1,00
AUF255086 07.10.2024 Okt. 08.10.2024 08.10.2024                          1,00
AUF255062 04.10.2024 Okt. 09.10.2024 09.10.2024                          1,00
AUF255060 04.10.2024 Okt. 08.11.2024 08.11.2024                          1,00
AUF255011 02.10.2024 Okt. 03.10.2024 03.10.2024                          1,00
AUF255019 02.10.2024 Okt. 03.10.2024 03.10.2024                          1,00
AUF255015 02.10.2024 Okt. 08.10.2024 08.10.2024                          1,00
AUF254996 01.10.2024 Okt. 03.10.2024 03.10.2024                          1,00
AUF254998 01.10.2024 Okt. 03.10.2024 03.10.2024                          1,00
AUF254942 26.09.2024 Sep. 10.10.2024 16.10.2024                               -  
AUF254929 25.09.2024 Sep. 23.10.2024 29.10.2024                               -  
AUF254872 23.09.2024 Sep. 24.09.2024 24.09.2024                          1,00
AUF254873 23.09.2024 Sep. 24.09.2024 24.09.2024                          1,00
AUF254853 20.09.2024 Sep. 26.09.2024 26.09.2024                          1,00
AUF254859 20.09.2024 Sep. 18.10.2024 31.10.2024                               -  
AUF254839 19.09.2024 Sep. 23.09.2024 23.09.2024                          1,00
AUF254824 18.09.2024 Sep. 20.09.2024 20.09.2024                          1,00
AUF254596 05.09.2024 Sep. 12.09.2024 12.09.2024                          1,00
AUF254543 02.09.2024 Sep. 10.09.2024 10.09.2024                          1,00
AUF254523 30.08.2024 Aug. 04.09.2024 04.09.2024                          1,00
AUF254501 29.08.2024 Aug. 05.09.2024 26.09.2024                               -  
AUF254310 13.08.2024 Aug. 20.08.2024 20.08.2024                          1,00
AUF254282 12.08.2024 Aug. 14.08.2024 14.08.2024                          1,00
AUF254267 09.08.2024 Aug. 13.08.2024 13.08.2024                          1,00
AUF254207 06.08.2024 Aug. 14.08.2024 14.08.2024                          1,00
AUF254194 05.08.2024 Aug. 08.08.2024 29.08.2024                               -  
AUF254037 23.07.2024 Juli 23.07.2024 23.07.2024                          1,00
AUF254046 23.07.2024 Juli 31.07.2024 31.07.2024                          1,00
AUF253884 11.07.2024 Juli 18.07.2024 18.07.2024                          1,00
AUF253821 08.07.2024 Juli 09.07.2024 09.07.2024                          1,00
AUF253815 08.07.2024 Juli 10.07.2024 10.07.2024                          1,00
AUF253584 24.06.2024 Juni 27.06.2024 25.07.2024                               -  
AUF253547 20.06.2024 Juni 21.06.2024 28.06.2024                               -  
AUF253553 20.06.2024 Juni 16.07.2024 16.07.2024                          1,00
AUF253304 05.06.2024 Juni 06.06.2024 27.06.2024                               -  
AUF253291 04.06.2024 Juni 06.06.2024 04.07.2024                               -  
AUF253166 27.05.2024 Mai 04.06.2024 04.06.2024                          1,00
AUF253116 23.05.2024 Mai 28.05.2024 28.05.2025                               -  
AUF248055 14.05.2024 Mai 17.05.2024 03.06.2024                               -  
AUF252912 10.05.2024 Mai 14.05.2024 14.05.2024                          1,00
AUF252916 10.05.2024 Mai 14.05.2024 31.05.2024                               -  
AUF252924 10.05.2024 Mai 23.05.2024 06.06.2024                               -  
AUF252786 29.04.2024 Apr. 03.05.2024 03.05.2024                          1,00
AUF252778 29.04.2024 Apr. 07.05.2024 07.05.2024                          1,00
AUF252653 19.04.2024 Apr. 23.04.2024 23.04.2024                          1,00
AUF252603 17.04.2024 Apr. 23.04.2024 31.05.2024                               -  
AUF252570 16.04.2024 Apr. 23.04.2024 23.04.2024                          1,00
AUF252419 08.04.2024 Apr. 10.04.2024 10.04.2024                          1,00
AUF252414 05.04.2024 Apr. 09.04.2024 09.04.2024                          1,00
AUF252401 04.04.2024 Apr. 11.04.2024 11.04.2024                          1,00
AUF252351 02.04.2024 Apr. 03.04.2024 03.04.2024                          1,00
AUF252220 25.03.2024 März 28.03.2024 28.03.2024                          1,00
AUF252217 25.03.2024 März 04.04.2024 05.04.2024                               -  
AUF252216 25.03.2024 März 28.03.2024 25.04.2024                               -  
AUF252199 22.03.2024 März 30.04.2024 30.04.2024                          1,00
AUF252174 21.03.2024 März 26.03.2024 26.03.2024                          1,00
AUF252148 20.03.2024 März 21.03.2024 21.03.2024                          1,00
AUF252104 18.03.2024 März 21.03.2024 28.03.2024                               -  
AUF252075 14.03.2024 März 18.03.2024 18.03.2024                          1,00
AUF251996 11.03.2024 März 13.03.2024 13.03.2024                          1,00
AUF252002 11.03.2024 März 13.03.2024 13.03.2024                          1,00
AUF251878 04.03.2024 März 08.03.2024 08.03.2024                          1,00
AUF251866 01.03.2024 März 04.03.2024 04.03.2024                          1,00
AUF251843 29.02.2024 Feb. 26.03.2024 26.03.2024                          1,00
AUF251791 26.02.2024 Feb. 29.02.2024 29.03.2024                               -  
AUF251674 20.02.2024 Feb. 21.02.2024 21.02.2024                          1,00
AUF251610 15.02.2024 Feb. 21.02.2024 21.02.2024                          1,00
AUF251603 14.02.2024 Feb. 19.02.2024 19.02.2024                          1,00
AUF251513 09.02.2024 Feb. 13.02.2024 13.02.2024                          1,00
AUF251479 07.02.2024 Feb. 08.02.2024 29.02.2024                               -  
AUF251416 05.02.2024 Feb. 08.02.2024 09.02.2024                               -  
AUF251418 05.02.2024 Feb. 11.03.2024 11.03.2024                          1,00
AUF251235 24.01.2024 Jan. 31.01.2024 01.02.2024                               -  
AUF251241 24.01.2024 Jan. 01.02.2024 01.02.2024                          1,00
AUF251195 23.01.2024 Jan. 20.03.2024 24.01.2024                          1,00
AUF251176 22.01.2024 Jan. 24.01.2024 24.01.2024                          1,00
AUF251097 16.01.2024 Jan. 18.01.2024 18.01.2024                          1,00
AUF251033 11.01.2024 Jan. 16.01.2024 16.01.2024                          1,00
Labels (1)
1 Solution

Accepted Solutions
marksouzacosta

Hi @maschi77 ,

That is great! Thank you.

Ok, usually, the KPIs have the "pure" version of the expressions and the same expression on the context of a chart with dimensions and other measures reacts to those dimensions AND measures.

You can try these exercises:
1. Copy the table chart you have, exclude all the dimensions and check the results (you should have only the measures).
2, Copy the original chart again, this time create one extra copy for each measure but leave the dimensions and only one Measure per chart (you will have four new charts). Check the results.

Also, check if you don't have the dimensions checked to exclude null values. This may be impacting your values.

So, this is a diagnostic phase you are doing to try to identify the problem. Next we can think about how to solve them.

Please let us know the results!

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

View solution in original post

6 Replies
maschi77
Contributor II
Contributor II
Author

To avoid misinterpetations...
correct --> Excel 😉

maschi77_0-1730208482028.png

wrong --> Qlik Sense

maschi77_1-1730210219359.png

I can't find the reason. can someone give me a helpful tip?🙏🏻

marksouzacosta

Hi @maschi77 ,

My solution is a mix of Load Script and Measure Expression changes.
I always recommend changing the Load Script to reduce the complexity of the chart measures.

I did some data treatment because your data format was different from mine but the important thing here is that Qlik must interpret your Date fields as Date field values, not as text.

Ok, so following the Load Script:

Orders:
LOAD
*,
If(ShippingDateConfirmed <> MakeDate(2016,1,1),1,0) AS ShippingDateConfirmedFlag,
If(ShippingDateRequested >= ShippingDateConfirmed,1,0) AS ShippingCounter
;
LOAD
OrderId,
Date#("Created Date",'dd.mm.yyyy') AS "Created Date",
CreatedDateTimeMonth,
Date#(ShippingDateRequested,'dd.mm.yyyy') AS ShippingDateRequested,
Date#(ShippingDateConfirmed,'dd.mm.yyyy') AS ShippingDateConfirmed,
If(Match(Service,'1,00'),1,0) AS Service
FROM
[lib://DataFiles/Orders.xlsx]
(ooxml, embedded labels, table is Sheet1)
;

 

And this is the new Measure:

{<ShippingDateConfirmedFlag = {1}, [Created Date] = {">=$(=Date(AddMonths(Max([Created Date]),-2),'DD.MM.YYYY'))<=$(=Date(Max([Created Date]),'DD.MM.YYYY'))"}>}Sum(ShippingCounter)/Count(OrderId)

Note that you don't need to repeat the Set Analysis Expression for every Aggregation if you write it outside them.

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

maschi77
Contributor II
Contributor II
Author

Hi @marksouzacosta ,

I have implemented your idea and it works perfectly in the table diagram. Thank you very much for your suggested solution, you are a hero!!!
Unfortunately, the results from the table chart can't be transferred to KPIs.
I have already tried different aggregation variants without success. Perhaps there is a tip here too 😉 ?

Formula (Service 3Mo) Diagramm and KPI:

{<ShippingDateConfirmedFlag = {1}, CreatedDateTimeDate =
{">=$(=Date(AddMonths(Max(CreatedDateTimeDate),-3),'DD.MM.YYYY'))<=$(=Date(Max(CreatedDateTimeDate),'DD.MM.YYYY'))"}>}
Sum(ShippingCounter)/Count(Auftrag)

Sript:

LOAD ..........

ShippingDateConfirmedMonth,
ShippingDateConfirmedWeek,
ShippingDateRequested,
ShippingDateConfirmed,
CreatedDateTimeDate,
If(ShippingDateConfirmed <> Makedate(1900,1,1),1,0) as ShippingDateConfirmedFlag,
If(ShippingDateConfirmed = Makedate(1900,1,1),1,0) as ShippingDateConfirmedFlag0,
If(ShippingDateRequested >= ShippingDateConfirmed,1,0) as ShippingCounter,
if(ShippingDateConfirmed = Makedate(1900,1,1) and (CreatedDateTimeDate - today(1))<-2,1,0) as tolateconfirmed

From lib://$(QVDPath_Schema)/SalesLine.qvd (qvd);

(Data format is already formatted in DWH)

maschi77_0-1730366718889.png

Regards

@maschi77 

 

marksouzacosta

Hi @maschi77 ,

That is great! Thank you.

Ok, usually, the KPIs have the "pure" version of the expressions and the same expression on the context of a chart with dimensions and other measures reacts to those dimensions AND measures.

You can try these exercises:
1. Copy the table chart you have, exclude all the dimensions and check the results (you should have only the measures).
2, Copy the original chart again, this time create one extra copy for each measure but leave the dimensions and only one Measure per chart (you will have four new charts). Check the results.

Also, check if you don't have the dimensions checked to exclude null values. This may be impacting your values.

So, this is a diagnostic phase you are doing to try to identify the problem. Next we can think about how to solve them.

Please let us know the results!

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

maschi77
Contributor II
Contributor II
Author

Hi @marksouzacosta ,

Thanks a lot, I've solved it ! I aggregated too few dimensions.

Best Regards,

@maschi77

seanbruton
Luminary Alumni
Luminary Alumni

Superb !!! Neat clear solution.